Easy Reference Comparison of Objects & Collections
Objects have become an essential part of the 4D language and of Qodly.
But when you declare a variable of this type, you define a reference. So, how do you know if two objects are, in fact, just one and share the same reference?
Starting with 4D 20 R6, comparing object references is simple: enter the = and # operators!
This blog post explores these operators and how they help determine if objects share the same reference. Let’s find out more!
Using Classes Across Components
Component developers frequently require the utilization of a class from another existing component.
With 4D 20 R6, when a component has a declared namespace, its classes are now accessible to all components loaded in the host project via cs.namespace.
Class property declarations and assignments on a single line
Streamlined Method Parameter Declarations
In the pursuit of efficient coding practices, 4D developers commonly configure compilation path settings to enhance syntax and typing checks, thereby minimizing errors during code execution in compile mode. Let’s see how #DECLARE method prototypes will gain time and code security.
A Fresh Approach to Writing Variadic Functions
Many of you are familiar with using methods or functions that can accept an unspecified number of parameters, often referred to as variadic functions.
In our ongoing process to improve your development experience, 4D v20 R3 streamlined the declaration of these methods by introducing ellipsis, making your code more straightforward and easier to work with.
Simplify Variable Declarations & Assignments in a Single Line
Starting with 4D v20 R3, you can wave goodbye to the days of writing multiple lines of code for variable declarations and assignments. Now, you can streamline your code, eliminate redundancy, and easily boost efficiency.
Here is how!
Meet the Updated Print form & FORM LOAD Commands
4D v16 R5 brought a significant improvement to the DIALOG command. An improvement that lays in the possibility of passing a new parameter “formData” of type object. It was great to hear that this new addition has been well received by 4D developers.
With 4D v20, two other commands are upgraded, Print form and FORM LOAD! The benefit will be just as great. The object’s content passed in the parameter will be directly exploitable in the printed forms or forms loaded in memory.
Comparison with an Undefined Value
Since the appearance of ORDA, classes, and other objects, you must work increasingly with undefined values.
Since some of you are asking for an easier way to use them, starting with v20, you can compare any type of value to an undefined value without throwing an error.
Object and Collection Literal Initializer
In your code, objects and collections can be instantiated using New object and New collection commands.
However, starting from 4D v20, a more convenient and readable approach is available using object literals and collection literals. These new features provide a simpler and clearer way to initialize objects and collections.
Support of larger integers than integer32
While Reals are known to be unprecise, they are 100% accurate even for very large numbers, as long as they do not use a decimal point (=integers).
Numbers up to 53 bit, or more exactly, [-(2^53)+1, (2^53)-1], that is a range from −9,007,199,254,740,992 to 9,007,199,254,740,992, will be exactly represented.
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