Tech Tip: Moving or changing the visibility of a group of objects
PRODUCT: 4D | VERSION: 13.2 | PLATFORM: Mac & Win
Published On: April 5, 2013
There are instances where a developer may want to move a subset of objects on a form or even hide them all at once. Both the 4D commands OBJECT MOVE and OBJECT SET VISIBLE make this possible. If the object name is used with a wildcard (@), then the operation can effect a group of object with a single call rather than just one object.
For example, say there is a form with a number of objects and we want to move just a group of three objects. This can be done in three seperate calls as follows:
OBJECT MOVE(*;"object1";10;10) OBJECT MOVE(*;"object2";10;10) OBJECT MOVE(*;"object3";10;10) |
Or the above code can be replaced with one simple call by adding a prefix to the object names in the group and with the use of a wildcard. If "group1_" is appended to the beginning of all three object names (group1_object1, group1_object2, and group1_object3), then the following code would move the three objects with one line of code:
OBJECT MOVE(*;"group1_@";10;10) |