How to create a simple “TimeStamp” class in 4D

Automatically translated from English

by guest author Tiran Behrouz, 4D developer (Vancouver, Canada) 

The introduction of ORDA in 4D v17 was a game-changer. Now with the introduction of classes in 4D v18 R3, we will witness a paradigm shift in 4D programming. We can now take advantage of object-oriented programming concepts such as polymorphism, composition, and inheritance to write our own class libraries. In this video, I demonstrate how to code a simple TimeStamp class using 4D and ORDA. 

I used 4D v18 R4 for this tutorial. You can also use the public 4D v18 R3 to develop this class, but your variable declarations will have to follow the classic 4D syntax. For example:

  • C_LONGINT ($n) instead of var $n: Integer
  • C_OBJECT ($1) instead of var $1: cs.Class.TimeStamp

 

The source code can be found here. Join the discussion on the 4D forum for questions and feedback.

Tiran Behrouz

Tiran has been developing B2B software with 4D since 2003. He has a passion for problem-solving and finding easy solutions to challenging problems. He is the CEO of Clear View Systems (CVS) based in Vancouver Canada. CVS develops software and solutions for small financial companies. He is the main developer of CurrencyXchanger which is being used by over 350 companies in 40+ countries.

Tiran has a Computer Science degree from the University of British Columbia and an MBA in Technology Management from the University of Phoenix. In his free time, Tiran enjoys reading, hiking, and biking.