version 6.7 (Modified)
GET OBJECT RECT ({*; }object; left; top; right; bottom)
Parameter | Type | Description | |
* | * | If specified = object is the name of the object (string) | |
If omitted = object is a variable | |||
object | Object | Object name (if * is specified) or | |
Field or variable (if * is omitted) | |||
left | Longint | Left coordinate of the object | |
top | Longint | Top coordinate of the object | |
right | Longint | Right coordinate of the object | |
bottom | Longint | Bottom coordinate of the object |
Description
The GET OBJECT RECT command returns the coordinates left, top, right and bottom (in points) in variables or fields of the object(s) of the current form defined by the parameters * and object.
If you pass the optional parameter *, it indicates that the object parameter is an object name (a string). If you don't pass the optional parameter *, it indicates that object is a field or a variable. In this case, you don't pass a string but a field or variable reference (only a field or variable of type object).
If you pass an object name to object and use the wildcard character ("@") to select more than one object, the coordinates returned will be those of the rectangle formed by all the objects concerned.
Note: Since 4D version 6.5, it is possible to set the interpretation mode of the wildcard character ("@"), when it is included in a string of characters. This option has an impact on the "Object Properties" commands. Please refer to the 4D Design Reference manual.
If the object doesn't exist or if the command is not called in a form, the coordinates (0;0;0;0) are returned.
Example
Let's assume that you want to obtain the coordinates of a rectangle formed by all the objects that begin with "button":
GET OBJECT RECT(*;"button@";left;top;right;bottom)
See Also