version 3
Last object Pointer
| Parameter | Type | Description | ||||
| This command does not require any parameters | ||||||
| Function result | Pointer | Pointer to the last or current enterable area | ||||
Description
Last object returns a pointer to the last or current enterable area, in other words, the object that the cursor is in or has just left. You can use Last object to perform an action on a form area without having to know which object is currently selected. Be sure to test that the object is the correct data type, using Type, before performing an action on it. This command cannot be used with fields in subforms.
Note: This command is to be used only in data entry context, otherwise it will return errors.
Example
The following example is an object method for a button. The object method changes the data in the current object to uppercase. The object must be a text or string data type (type 0 or 24):
$vp := Last object ` Save the pointer to the last area If ((Type ($vp->) = Is Alpha field) | (Type($vp->) = Is String var)) ` If it is a string or text area $vp-> := Uppercase ($vp->) ` Change the area to uppercase End if