When you use collections with a member method that needs a callback method, many of you have asked us for a more straightforward way.
You asked; we delivered!
Starting with 4D v19 R6, 4D allows you to use a formula to define a callback in the collection member functions, the EXECUTE METHOD IN SUBFORM, CALL FORM, and CALL WORKER commands. If you can reduce your code to a simple expression, you can pass it directly into the formula without using a method.
When a 4D Write Pro document contains external elements resulting from expressions or formulas, they are visible when the “Display expressions” mode is used. Still, they are blended into the text when the values are displayed. This is what you want for a final document, but it is sometimes useful to easily view these calculated values while writing the document. Well, 4D v19 R3 is giving you new display options for this purpose!
4D v18 R5 introduces a new command that simplifies writing your code: VP SET CUSTOM FUNCTIONS. It creates custom functions in 4D View Pro which execute 4D formulas.
Thanks to this command you can now allow 4D commands, fields, variables, methods, or any arbitrary expression to be used in your cell formulas. For example, there’s no need to create a method to use a simple variable in 4D View Pro, just pass it as a parameter to your Formula.
As a 4D Write Pro user, you’ve most likely used expressions (or more recently, formulas) to automatically fill in certain parts of your documents. These formulas can return “raw” text or images. In the case of text, they may contain line breaks. The question is how should these line breaks be handled when they are processed inside 4D Write Pro documents? This blog post provides the answers … keep reading!
With 4D v18 R2, 4D Write Pro is able to manage formula objects inside documents. To do so, four new commands have been created: WP Get formulas, WP Insert formula, WP Compute formulas, and WP Freeze formulas. They all can be used with intuitive targets like document, body, headers, etc. And as you may have guessed from the command names, formulas are no longer text expressions but powerful formula objects!
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!
In 4D v17 R6, ORDA queries are becoming increasingly more powerful and concise. This blog post is for those of you who need more sophisticated search criteria than just a simple syntax like “name = Smith‘”. With this R-release, you can use any project method or 4D expression in the query() member method by using formulas.
What better way to explain this feature than with an example? Let’s dig into the details.
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 R4 is on the way with a cool new 4D View Pro feature: named ranges and formulas. If you need to use formulas with references to cell(s) or constant(s), this feature can be a great help!
With these new commands, your formulas are more readable and easily accessible with 4D View Pro’s automatic completion.
Imagine you have a list of formulas containing table names and some fields … then days later you decide to rename your tables. Now your formulas are no longer valid, which is totally understandable!
Well, good news: the new Parse formula command allows your formulas to remain valid when renaming 4D language or structure elements.