changeobject
OBJECT
,
PROPERTY
,
VALUE

The changeobject statement modifies the properties of one object in a form.


Parameters

This statement has three parameters:

object – specifies the object to be modified. The object does not have to be selected. A text value specifies the object by name (see Object Names). A numeric value specifies the object by ID number.

property – the object property (color, font, etc.) to modify. See Modifiable Object Properties for descriptions of the different properties that can be modified. Standard properties can be specified in either upper or lower case, but native properties are case sensitive.

value – The new value for this property. Note: Instead of specifying the property names and values as separate parameters, you can specify multiple properties with a dictionary. See the main text below for more information.


Description

This statement modifies a single object in a form, which can be specified by name (if it has one) or by the object ID number. For example, this code will make the Photo Border object one inch taller and wider.

changeobject "Photo Border","rectangle",rectangleadjust(objectinfo("rectangle"),0, 0, 72, 72)

Note: You can specify multiple property/value pairs in a single changeobject statement, like this:

changeobject object,property1,value1,property2,value2,property3,value3

For example, this procedure makes the clicked object semi-transparent red.

changeobject info("clickedobjectid"),"color",rgb(65535,0,0),"opacity",50

You can also specify the properties with a dictionary, as shown below:

changeobject info("clickedobjectid"),
    initializedictionary(
        "color",rgb(65535,0,0),
        "opacity",50)

The two previous example perform the exact same modification to the clicked object. The advantage of using a dictionary is that you can prepare it in advance in a variable, and then use it over and over again (possibly adjusting it with the changedictionaryvalues( function).

There are literally hundreds of different object properties that can be modified with the changeobjects statement. To learn more, see Modifiable Object Properties.

Note: Don’t confuse the changeobject statement, which modifies a single object without selecting it, with the changeobjects statement, which modifies one or more selected objects.


See Also


History

VersionStatusNotes
10.0UpdatedNew in this version.