How to create a simple “TimeStamp” class in 4D
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.
New declaration syntax for an intuitive autocompletion
Have you ever wondered about 4D’s autocompletion feature or asked yourself why 4D suggests all functions used in the code? Since an object is a very generic type, 4D only knows what it’s really storing at runtime. However, that doesn’t help much when you’re writing your code.
4D now offers a new, alternative syntax which will greatly enhance autocompletion when declaring your variables.
4D Write Pro – More control when using formulas
As a 4D Write Pro user, you’ve most likely used expressions (or more recently, formulas) to automatically fill in certain parts of your documents. These formulas can return “raw” text or images. In the case of text, they may contain line breaks. The question is how should these line breaks be handled when they are processed inside 4D Write Pro documents? This blog post provides the answers … keep reading!
Server code development in project applications
Developing and debugging server code in project applications has become easier than ever in 4D v18 R4. Without further ado, let’s take a look at how to do it.
Access form object values by programming
An increasing number of developers are using the Form command to link their form objects and many of you require easy programming access to the values of those objects. So, to help you access the value of a form object, regardless of its variable or expression, we’ve added two new commands: OBJECT Get value and OBJECT SET VALUE.
Let’s see how to use them!
Use an offscreen web area
Do you need to load web pages, extract metadata, or generate pictures from the contents of pages on a headless server? If you answered “yes”, then you’re in luck because 4D v18 R3 makes it possible! Now you can create an offscreen web area with the WA Run offscreen area command.
Download your emails in MIME format with POP3
Do you need to store all business emails, for example, for legal or fiscal purposes? These documents must be stored as they are. That is, how they were received … in their original, unconverted formats. 4D v18 R3 answers this need by providing you with a new method allowing you to get emails in their original MIME format.
ORDA: an up-to-date datastore without restarting
We’re thrilled to announce that 4D v18 R3 includes an enhancement that will have a huge impact on the developer’s experience. A feature many of you have requested, and 4D delivers!
When you work in 4D standalone mode during the development phase (writing and testing your code), you’re no longer required to restart your database in order to have an up-to-date datastore (ds) when the structure is updated!
Now you don’t need to restart the database each time you need a new attribute or a new table in your code! It’s all automatic!
When you call the ds command, you get an up-to-date datastore object. This means that several versions of this datastore object are handled at the same time … depending on when you updated your structure … without breaking running processes.
If you work in client / server mode, this works fine for code running on the 4D Server.
For remote clients, you simply need to restart the client requiring the structure’s update.
Project Databases: Method documentation is back
When developing an application, it can be very useful to have quick access to the details of a method (e.g., an explanation of what it does, its syntax, and a definition of the parameters passed to it). This becomes even more important when using a compiled component. You can’t look at the content of the method, so you can only rely on its documentation to understand how to use it.
The Explorer’s dialog has been enhanced and documentation is now available in 4D v18 R3 for project databases.
Multiple web servers in a single 4D instance
Have you ever needed to use multiple web servers in order to, for example, split your web application code into several business units, or separate the administrator’s web server from the user’s or run an old part, not preemptive-ready yet, in a separate instance, allowing the main part to run preemptive?
If you’re nodding your head yes, then keep reading because 4D v18 R3 allows you to do so … with ease.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy