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!
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.
Create a BLOB attribute in an object
With the introduction of classes in the 4D environment, the need to store your data in objects, and especially blobs, has increased. That’s why 4D v19 R2 lets you encapsulate blobs in objects.
Beyond the storage aspect, since the blob object is a reference type, your performance in terms of memory occupation and speed will be greatly improved.
ORDA: Easy looping with a new 4D tag
You have probably already used a For each…End for each loop to work with ORDA entity selections or with collections. Its use is simple and straight forward. Would like to use it as a 4D tag in your SHTML pages? Or perhaps with the PROCESS 4D TAGS command?
As of 4D v19, you can! Keep reading to learn more.
Objects Corner: easy sharing & other good news
How many times have you gotten the “Not supported value type in a shared object” error when trying to put an object into a shared object?
What did you do? Write longer code to turn your innocent object into a shared one, perhaps iterating over all of its properties?
How about transferring a shared object from one shared group to another?
An interesting thing about objects: you already know they can be used as a hash map (a key/value system), but what about gettings all the keys or all the values with a single line of code?
Keep reading, because 4D v18 R3 is out and brings good news!
Zip/unzip files and folders with these commands
Before exchanging files (by email for example), we often compress them to reduce their size before transmitting them. With 4D v18, you can compress and uncompress your files by programming without the need for external libraries or tools. Here are the new commands that allow you to do so:
Power of objects and dot notation
With 4D v17 R5, we showed you how easy it is to manipulate an object to retrieve the attributes of a file or folder. Things have gotten even easier thanks to object notation! In this blog post, we’re providing you an HDI with a user interface to manage files and folders. This isn’t new in 4D since you could do it with classic 4D commands, but now you can do it easier and with fewer lines of code!
Object notation to handle files and folders
4D already provides commands to handle files and folders, but what about new commands that take advantage of the power of object notation?
Objects have changed the way many 4D developers write code, making it more generic, flexible, easier, and faster. Now this wave of change is extended to files and folders. In this blog post, we’ll show you how easy it is to manipulate an object in order to retrieve the attributes of a file or folder (rather than calling several commands and storing the information in multiple variables). Things are getting a lot easier!
Read 4D object fields with SQL Engine
A 4D object field is a persistent database field type, stored as binary content. Previously, reading this type of field by an ODBC driver wasn’t possible. Until today.
Before, an error was returned when trying to read an object field. This prevented the completion of simple Select * from myTable requests, which could be frustrating for users who only wanted to browse the content of a table.
Good news! The SQL engine has been updated to allow 4D object fields to be read.
Get info about the running application
4D v17 R3 takes your database analysis a step further by enabling you to create a customized server administration dialog. Following the ability to retrieve information about users & processes, getting all runtime information about 4D Web server, getting details about the active license, and getting all of the hardware and system details, you now also have the ability to retrieve the activity and network configuration of the running database.
Do you need to know on which IP address and port the database is listening, if communications between the client and the server are encrypted, or if the legacy network layer is used? Just call the new command, Get application info. And that’s not all! This command also returns information about the database such as: the amount of CPU used, the time since its been started, and the list goes on.
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