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!
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.
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.
Your forms may need to be changed depending on your customer or user needs. For example, the color black might be perfect for one user but not so much for another user (who sees blue as the ultimate perfection). Luckily, dynamic forms (introduced with 4D v16 R6) are here to help you handle your users’ preferences. But rewriting an existing form to a dynamic form could be a difficult task, and it’s not always easy to start with a blank page. Ideally, it’d be best to have a draft that can be modified and improved. With 4D v17 R3, it’s now possible to easily convert a classic 4D form (stored in .4DB file) to a dynamic form.
A new command is at your disposal allowing you to use formulas in your code. You can now encapsulate them in objects and call them when needed. There’s no more need to write your code as text. Now you can just pass your formula in your command and that’s it! This is a great addition, since your code isn’t text, you can benefit from Syntax highlighting and all the other advanced functionalities of the code editor!
ORDA was one of the major announcements of 4D Summit 2018, opening a world of new possibilities in 4D. To learn more about ORDA and its benefits, check out this post to see how ORDA will change the way you work.
Objects are at it again, continuing to demonstrate their utility to ease your life as a developer.
Using time (or duration) values inside of objects is now smoother and more intuitive. Beginning with 4D v17, times inside objects are set as seconds – and not milliseconds!
Starting with 4D v17, the content of a multilevel collection can easily be displayed in different list boxes. Meaning that you can bind several list boxes to display nested details … without a single line of code! This can be achieved by simply using an object or a collection as the data source for another list box!
With the new list box collection type, the “Current item” and “Selected items” properties have been added. Keep in mind that the “Current item” property allows you to get an object, while the “Selected item” property returns a collection.
Imagine that your database contains several tables of types or categories. These tables are very simple, often with only an identifier and a text field. For demonstration purposes, let’s say it’s a shoe management database. To qualify the products, we need to define their type, color, pattern, material, season and so on.
It’s cumbersome to manage each of these tables in a list form and an input form and associated methods. In this case, the use of a generic form is essential to avoid duplication and simplify maintenance.
ORDA provides a great feature to channel data through filters and get aggregated values, by including a set of easily-understood aggregation operations that examine and perform calculations on the data sets. For example, the sum, average, count, min, and max methods are used to perform the operations which their names describe!
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