New in 4D v16 R4 is the command FORM GET ENTRY ORDER (and FORM SET ENTRY ORDER). This command allows for dynamic control of the entry order in forms, allowing a developer to modify entry order with code rather than strictly through the user interface of 4D.
There is a subtlty that needs to be understood about this command, which surrounds what objects are returned by the FORM GET ENTRY ORDER command.
Consider a simple form with 3 input variables and a button, with the following entry order as seen in the form editor:
The button method runs the FORM GET ENTRY ORDER command, which returns the entry order for the form.
It might seem like the output array from the command would contain 4 objects, the 3 varX variables and the button, however this is not necessarily the case. Running the form and clicking the button yields the following:
So what happened here?
By default, a button placed on a form is not focusable, and the object property needs to be turned on. After selecting the focusable property for the button, it may be expected that the button would appear in the $objNames array, but it does not!
Looking at the Modifying data entry order documentation will explain what is going on here, and provide a clue to how to get the button returned in the command.
Here is the relevant line from the documentation: "The data entry order is the order in which fields, subforms, and other active objects are selected as you hit the Tab or the Carriage return key in an input form."
So the button does not show up because, though it is focusable, it is not tabable!
If the tabable property is selected for the button, then it is returned in the $objNames array from the FORM GET ENTRY ORDER command.