Formula – Think outside the box
According to the top 10 blog posts of 2019, the Formula: More power behind simplicity post ranked quite high … in the top five. It seems that Formula really grabbed your attention, so here’s another tip that Vincent de Lachaux (developer and 4D expert) has shown me and I’m sharing with you!
Formula: More power behind simplicity
The Formula command is available since 4D v17 R3. So far you might have thought of assigning a formula as a method to an object or building smart objects that can calculate values or do anything you need. That’s really great, and there’s more than meets the eye!
I had a great demonstration from Vincent de Lachaux – Developer and expert 4D – on how he uses this command. For this blog post, I compiled different scenarios from that demo to give you insight on a different dimension of this command.
4D v17 R3 is here!
4D v17 R3 is now available!
To whet your appetite, here’s an overview of what this R-release has to offer:
- Create your own object methods and move one step closer towards classes in the 4D language.
- More 4D for iOS features for a customized mobile application with data formatters, personalized templates, and the ability to add your own icons.
- The ability to export the .4DB file into multiple text files as a first step towards full source control support – coming in a future release.
- 4D Write Pro is getting more feature-rich with new commands and attributes to create complex and beautiful documents.
- Import and export Microsoft Excel documents (.xlsx format) with 4D View Pro.
All of this and more awaits you!
A component to export the structure file
Thanks to 4D v17 R3, you can export your structure file in multiple text files. For example, with only a few lines of code you can create a copy of your database every morning. You can use this to keep track of the history or to send your database to a colleague and see the changes when they’re done working on it.
We provide you a ready-to-use component with only two methods: one to configure the data to be exported, and the other to export your database.
Better documents with two new attributes
To produce a nice document, you need to respect some typesetting rules and fundamentals. For example, the grammar, spelling, and structure of your document shows the quality of your text. One of these rules concerns the distribution of paragraphs and tables over multiple pages.
4D Write Pro offers you two options to manage paragraph distribution:
- Avoid page break inside paragraphs or tables, and
- Avoid widows and orphans for paragraphs or tables.
Let’s dig into more details.
Improving databases tests
As a developer, you’re aware that improving the quality of your developments is often based on unit tests. In order to launch these tests, developers and QA teams need tools to launch 4D databases in different modes (single user / client-server) and distinct environments (Macintosh / Windows).
4D products can already be launched using command line parameters to allow automatic testing or deployment. What if you want to create your own update mechanism or you need to handle a server farm with hundreds of 4D Servers running? Maybe you want to specify which database file to use – or pass parameters on launch …
Use your own icons in 4D for iOS
As we’ve seen in the last two 4D for iOS blog posts (data formatters and the creation of custom templates), 4D for iOS is becoming more feature-rich with each version. This provides more options when building your 4D for iOS applications. In this blog post, we’ll look at how you can use your own icons for more personalized apps.
Page layout in 4D Write Pro
When creating a 4D Write Pro document, you need to define the page size, orientation, and margins. Starting with v17 R3, you can do all this by programming. And for that, new attributes are at your disposal.
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.
Convert classic 4D forms to dynamic forms
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.
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