Visual Code Editor new features
copy linkIntroduction
This article describes the main new features of the Visual Code Editor (VCE). Reading it is recommend for people who have already used a previous version of Instant Developer in order to quickly learn how to use it and appreciate its benefits.
Other new features in the final version
- Managing object chains: to write a statement that acts on an object chain, simply press the backspace key after entering the second object, at the point when the statement is written as object.object = expression.
- Text copy/paste inside constants: it's now possible to copy or paste in text format inside the constant values directly in the VCE.
- New line in constants: to indicate a new line inside a constant, use the expression \n.
Other new features in the beta version
- Curly brackets: if a block contains only one line of code, the curly brackets that contain it can be deleted. Press the backspace key when the cursor is on the open curly bracket. To restore the brackets, press Enter on the block header line.
- For-each-row ReadOnly: now it's possible to create a read-only for-each-row block that does not change the data in the underlying table even if the columns returned by the query are changed.
- Quick-closing forms: pressing ESC twice in a row will close any active form. Forms that closed with a single ESC will continue to behave as they did before.
- Copy paste from the object tree: in addition to being able to drag objects from the tree with D&D in the code editor, it's now possible to get the same result using copy/paste.
- Tab on empty line: if the empty line is under a query, the Tab key will insert a SET or WHERE type line depending on the type of query.
- Properties form instant open: adding a new object using the context menu will immediately open the properties form so that they can be edited without additional clicks. For methods and queries, the code editor will be opened immediately.
- Cursor management: the VCE now manages the cursor like a normal text editor even though the code is still saved as relational code and not as a text file. To move around in the code, it's also interesting to use the Tab key, which moves the cursor onto the next editable tokens in the text.
- Selection management: in addition to selecting by line, the VCE now supports selecting tokens like a normal text editor. Different text selection options are available, such as deletions, enclosing in parentheses, moving, etc., and the visual code will remain consistent during the changes. To perform a drag&drop inside the VCE, you must first select the code to be dragged, and then perform the drag starting from one of the selected tokens.
- Continuous editing: it's no longer necessary to press Enter or Tab to confirm the token from the list of options. You can continue to write formulas normally and the VCE will automatically confirm the tokens as they are formed.
- Managing constants: entering constants in the code has become the same as in a traditional code editor: the character constants must begin with double quotes, date constants with #, numeric ones are written normally, and to enter the null constant write null. All the constants created in the VCE will be displayed by value instead of by name, like in previous versions; however, it will be possible to reference by name the constants in the value lists associated as domain with the database fields or with other objects. Finally, the constants can be moved to other value lists, such as for example the messages list, with a command in the VCE context menu, or by acting on the objects tree in the library section.
- Connecting to form and report editors: pressing F4 starting from a reference to a visual object will open the corresponding editor and the object will be located and highlighted in red, even if it's a panel field only visible in-form, in the fifth page of the panel, which is in a tabbed view...
- Operators overload: now the VCE is able to adapt the operator selected to the type of data in the formula, so there is no longer a difference between the “+” between numbers, the one between strings, and so on. The “IS” operator has also become a variant of the “=” operator, except that it works between pointers and not between scalar values. Some alternative forms of operators have been added (== and =, != and <>,…) so you can choose the preferred syntax.
- Increment operators: increment and decrement operators can now be used applied to an integer variable (i++, i--), but only as assignment instructions or in the for block. The operator is converted to the form “variable = variable + 1” or “variable = variable – 1”, so the use of “++” or “--” is therefore only an editor abbreviation.
- Defining variables in the for cycle: a new variable can now be defined inside the for cycle initialization statement. For example, you can write a statement like the following: for (int i=0; i<10; i++), with the same syntax as traditional languages.
- Elseif constructs: an elseif construct was added in order to be able to write multiple exclusive execution conditions in a way that's easier to read. So now it's possible to create if-elseif… elseif– else constructs without resorting to subsequent indentation.
- if-while-for-else-elseif substitution: it's now possible to convert a block into another form, from among those listed. To do so simply replace the keyword with the one you want.
- Moving parts of code: it's now possible to move every part of the code by pressing ctrl-arrow or ctrl-shift-arrow. In previous versions this was only possible for whole statements.
- Copy/paste: copy/paste capabilities for the code have been expanded; among other things it's now possible to copy the right side and the left side of statements crosswise.
- Managing comments: the comment text can be edited like in a normal text editor. What's more, the comment is no longer strictly linked to the object that follows it, but is retrieved if the current one is deleted or moved. Finally, you can insert a comment by simply beginning to write // in an empty line in the editor.
- Watermarking: when writing code, the parts to be completed will be highlighted with a placeholder, in some cases underlined in red if that part is mandatory. For example, if you introduce a call to a method, placeholders will be generated for all the parameters, highlighting in red those that are mandatory.
- Optional parameters: if a call to a method allows optional parameters, these will be expanded while the call is being written, so that their values can be set. If they are not specified, the VCE will display them afterward in collapsed form (...) in order to make it easier to read the code. You can press any key on the collapse dots to expand them again and so they can then be entered.
- New line in expressions: by pressing Enter after an operator you can go to a new line inside an expression, making it easier to read.
- Formula graph: pressing F4 when the cursor is on an operator or constant will open a graph of the structure of a formula, which can be useful in some cases to understand the sequence of operations that will be performed.
- Unused variables: cursor columns and variables defined but not used in the code will be underlined in green to indicate their current uselessness.
- Creating parameters and variables: dragging an object, like a database field for example, onto the title of the procedure will create a parameter; dragging the object onto an empty line will create the variable in that line.
- Deleting parameters from a procedure or function: when deleting parameters from a procedure or function, the code for the calls to that method will be updated, deleting the actual parameter corresponding to the formal one that was deleted.
- Retrieving actual parameters during editing: when editing expressions, if you delete a call to a function, all the actual parameters will be retrieved, and not just the first of them.
- Editing report, domain, check-constraint formulas: now editing for all expressions, including those separate from the procedural visual code, like those for check-constraints, is done through the VCE. The old expression editor is therefore no longer in operation.
- Editing queries: query writing is now achieved more naturally. For example, to obtain an update query on a table, it's no longer necessary to first write the name of the table, but the keyword update. To learn more about the new features in this area, we recommend reading the Visual Code Queries chapter, also available through the contextual documentation.
- Automatic SQL Where: the option for adding dynamic SQL code in a visual code query is activated automatically by selecting a character-type variable in memory as the filter expression.
- Database fields D&D: it's now possible to drag database fields directly into query expressions.
- Names of variables: when creating a variable in the visual code, the name of that variable will be selected automatically, and many times it will be the correct one. Obviously, it's possible to edit the name selected by the system by simply entering the one you want.
- foreach cycles: in the foreach cycle on queries, the record of selected columns is no longer visible, but they can be referenced directly through the names of the master query columns; this makes the code easier to read. The foreach cycle on collections however is written differently: selecting a collection, the instruction takes the form for each form (document) (name) in (collection), and in this case as well it is not necessary to specify the record. Finally, the foreach cycle on panels is selected simply by writing space and the name of the panel after the for-each-row keyword for the normal cycle on the query.
- Context menu: the VCE context menu is noticeably richer, also taking on all the commands that were previously only available from the object tree.
- Exception reports: The keyword error has been replaced by the word throw; obviously this occurs transparently in existing projects. An option has been added to edit the error message directly on the line in which throw is called.
- This: now the keyword this is managed unambiguously inside the VCE.
- Application object: to reference the properties and methods of the application object, you can now use the name of the application or this, if the call is made in the context of the application. You can now directly reference the method without any prefix.
- Public form methods: it's now possible to call a public form method by writing the name of the form and then the method. This way it's also possible to reference global form variables.
- Large characters: the VCE has also been optimized for large character screens (120 dpi).
- Introductory course: the new VCE preserves compatibility with the techniques demonstrated in the introductory course, so its behavior is slightly different during execution of initial lessons.
Changed on: 15/12/2022 / From version: 9.0.3940