Working with JSON Pointers
In 4D v16 R4, we enriched object commands so you can validate JSON objects. 4D v16 R5 is going even further by introducing the support of JSON pointers. Great – but what is a JSON pointer and what can I do with it?
Just like you don’t store company details for each employee in a database record (using a link to the company record instead), it can be really useful to structure a JSON document with parts that can be reused in a number of places.
For instance, let’s take an example of a website order; the customer enters the shipping address and designates the billing address as the same. Instead of duplicating the address information, we can define the shipping address as a reference to the the billing address.
Programmatically manage headers and footers in 4D Write Pro
We’ve received several customer requests to provide the ability to use the 4D Write Pro template with headers and footers to create other documents based on this template. Well, we heard you and this is available in 4D v16 R5.
A new set of commands have been added to 4D Write Pro to fulfill this need. Some of these commands can be used to get references of headers, body and footers inside documents. Others are handy to get a reference to the frame (header, footer, etc.) where the cursor is currently located, or to set the cursor into a specific frame.
Don’t be afraid of undefined values
With 4D v16 R4, we introduced Object Notation which is a great enhancement to the 4D language: your code is fast, flexible, efficient and elegant! This feature created a lot of interest on the 4D forums and we received a lot of feedback from our customers highlighting situations when there were undefined values making the code challenging to write.
With 4D v16 R5, we have taken your feedback into account and have simplified the use of undefined properties and values with Object Notation.
Passing data back and forth between forms
Wouldn’t it be great if you could just open a form and pass it some parameters to initialize your form objects? What about being able to also get the data back to process, after it’s been modified by the user? 4D v16 R5 makes your coding so much easier by greatly simplifying communications with forms.
Until now, when you wanted to display data (not coming from the database itself, but computed or external) to multiple users, you had two options: either write complex code to handle data display in multiple processes, or create as many forms as necessary with a bunch of global variables. But you know that global variables are not an optimized way of coding, from a memory point of view.
So get rid of your complex code and global variables! With 4D v16 R5 you can just bind an object to your form and use it internally with the new Form command. Painless…and powerful!
Retrieve the license information by programming
When you perform analysis, reporting or debugging of your server application you may want to know the number of available clients, the number of consumed connections, the expiration date and many other information.
Now with 4D v16 R4, you can retrieve detailed information about the active license of your running 4D product (4D Server for instance). For example:
- version,
- platform,
- number of available and consumed connections for 4D Write Pro,
- number of available and consumed connections for 4D Client,
- expiration date,
- …
Create your own process and user monitoring
You need to get the list of processes running on your 4D server, 4D remote or 4D standalone to create your own Administration Window? You want to know which user initiated each process to create a monitoring window of your application or log this information in a database to analyze later your server load? It is now easy to retrieve this information by programming with a new command: Get process activity.
Define the tab order by programming
Here are 2 very common developer needs: 1. Depending on the user criteria, you want to rearrange the objects in the form. – 2. Depending on the selected item in a list, you want to show, hide or move the objects in the form.
In all theses cases, you need to change the tab order of the form objects. Now in 4D v16 R4, you can modify the tab order at runtime by programming. To do so, 2 new commands have been created: FORM SET ENTRY ORDER and FORM GET ENTRY ORDER.
New type supported by 4D: Null
4D introduces a new Null type to ease the management of objects and collections. Thanks to the null value, you can represent a missing value and easily verify if your object or collection is correctly set.
4D initiates a new variable type: Collection
4D v16 R4 introduces a new type of variable called Collection. What are these variables intended for? Like Objects or BLOBs, collections can be used to hold almost any kind of variable types like texts, numerics, booleans, objects and even other collections. The good thing is that, all these variables types previously mentioned can be mixed inside the same collection, where arrays must always contain the same type of elements!
Add an hyperlink to your company logo in 4D Write Pro
A less well known usage of 4D Write Pro product is the production of HTML emails. In fact you can create a 4D Write Pro document including 4D expressions, text and images, then modify the document, paragraph or text properties and send it by email. In this context, a very common need is to add a link to a picture, e.g. your company logo.
4D Write Pro has been enhanced with 4D v16 R4 so that hyperlinks can now been added to text and/or pictures. Setting a link to your company logo or company name is now as easy as styling some text to bold.
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