An increasing number of developers are using the Form command to link their form objects and many of you require easy programming access to the values of those objects. So, to help you access the value of a form object, regardless of its variable or expression, we’ve added two new commands: OBJECT Get value and OBJECT SET VALUE.
Let’s see how to use them!
OBJECT get value
To get the value of a form object, use the OBJECT Get value command with the name of your form object as a parameter.
For example, to get the value of the current object:
$value:=OBJECT Get value(OBJECT Get name(Object current))
OBJECT SET VALUE
In the same way, to set the value of a form object, use the OBJECT SET VALUE command with the name and the new value as a parameter.
For example, to set a new value for the current object, just write:
OBJECT SET VALUE(OBJECT Get name(Object current);"New value")
With just a single command (OBJECT SET VALUE), you can change the form object’s value! 4D even checks if it is an assignable expression or a variable and sets the value when possible.