Simplified navigation between development windows
When writing a new function or method, or when creating a form, the work is never linear. We usually need to:
- access the explorer to find the form in its folder
- access the explorer to write the documentation for the method
- read the documentation of a command on the 4D documentation website
- read the documentation of a component’s method
In this new version, we have added some menu items in the code editor and form editor to allow you to better navigate between the different elements of a project.
Show online documentation directly from the code editor
In the latest versions of 4D, several improvements have been made to simplify the writing of code with classes:
- function and attribute suggestions according to type
- display of the prototype with a short description
With 4D v19 R2, you can open the online documentation of a function with a single action.
Code Editor: Multiple themes, your choice!
The code editor’s feature set grows with every release, and 4Dv19 is no exception.
Every developer has their own special – and sometimes peculiar – taste when it comes to their code editor (font, font size, color of the elements, etc.). What looks great and boosts productivity for one developer can be an obstacle for another. That’s why 4D v19 introduces theme management.
If “creating my own theme” is on your bucket list, now is the right time to check it off! 4D v19 comes with basic themes that you can enrich and adapt to your own taste.
Code editor: Write more code in less time!
With 4D 18 R4, we announced the availability of the suggested functions for classes (4D and data model). With 4D v18 R6, we’ve got more great news to simplify and facilitate the writing of code in the editor: The prototype of a function and a short description are displayed in the code editor!
Speed up your development process and avoid typos. Now, information about class functions is displayed in the code editor, helping you to write more in less time while making sure that you’re on the right track!
Let’s find out more!
Coder-friendly syntax for class functions and methods
Using $1, $2, and $n variables in your code not only makes the code less readable, it can also increase confusion since the human brain can find it difficult to remember what these variables correspond to. The solution is to create a variable with an understandable name and assign it the value of $1, $2, or $n.
4D v18 R5 has good news, you can now name your parameters when declaring:
- a project method,
- a trigger
- a database method
- a form method
- a constructor of a class
- a function of a class.
Let’s see how!
New declaration syntax for an intuitive autocompletion
Have you ever wondered about 4D’s autocompletion feature or asked yourself why 4D suggests all functions used in the code? Since an object is a very generic type, 4D only knows what it’s really storing at runtime. However, that doesn’t help much when you’re writing your code.
4D now offers a new, alternative syntax which will greatly enhance autocompletion when declaring your variables.
Code Editor: Say hello to Comment blocks
Adding a block of comments at the beginning of a method is useful for adding a note about what a method does, as well as a list of input/output parameters. And having a few lines of human-readable text within a complicated section of code can be convenient to help you and others recall the purpose of this particular section of code. Beginning with 4D v18, your programming experience is enhanced with the addition of comment blocks!
Check out the Code Editor enhancements
The 4D Code Editor just got more user friendly! Say hello to character completion for quote marks “ ”, parentheses ( ), brackets [ ], and curly braces { }, as well as command blocks (For…End for, If … End if, etc.). But that’s not all, bracket matching has also been added to help you manage your collections, and the syntax for user methods is now displayed in the status bar just like a 4D command syntax!
4D Methods editor with dark theme
Humans have different taste preferences. For instance, some people prefer white over all other colors, while others find black to be more majestic … hence any new color trend tagged as ‘the new black’!
In order to accommodate different preferences, 4D enables you to personalize the method editor theme!
In the 4D preferences dialog, you can set several parameters for the editor such as the color of the background or each type of code element (i.e., commands and comments).
Thanks to these different options, you can completely customize the method editor to your taste. Whether you’re a fan of light or dark themes, 4D’s got you covered!
Here’s what a dark theme looks like:
New preferences in Method Editor
You want to visualize occurrences of a given variable in the 4D method editor? Or you find your method code too heavy with all those block icon and lines everywhere that it’s becoming hard to read?
With 4D v16 new preference options are available in the code editor to make the 4D developers’ life easier!!
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