Object Properties
A property is a number or a text string associated with an object which can be read or set with script.
- objName.Property
- objName is the name of the object.
- Property is a valid property for the type of object.
Note: You can return a list of available object properties to the Script Window by typing the following:
|
Contents
- 1 Setting a Property Value
-
2 Returning a Property Value
- 2.1 Read the current value of a numeric property and assign the value to a variable:
- 2.2 Read the value of the numeric property in the Script window:
- 2.3 Use substitution notation to return the value of a numeric property:
- 2.4 Read the current value of a text property and assign the value to a string variable:
- 2.5 Read the value of the text property in the Script Window:
- 2.6 Use substitution notation to return the value of a text property:
Setting a Property Value
- Numeric properties are set by LabTalk scripts using statements with the following syntax:
- objName.Property = value
- objName is the name of the object.
- Property is a valid property for the type of object.
- value is a number.
- Text properties are set by LabTalk scripts using statements with the following syntax:
- objName.Property$ = value
- objName is the name of the object.
- Property is a valid property for the type of object.
- value is a text string.
Returning a Property Value
The value of a numeric property is read and assigned to a variable using the following syntax:
Read the current value of a numeric property and assign the value to a variable:
variable = objName.Property
Read the value of the numeric property in the Script window:
objName.Property =
For example, entering the following script in the Script window:
page.active =
could return
page.active = 1
indicating that the first layer of the page is active.
Use substitution notation to return the value of a numeric property:
type -a "The property is $(page.active)";
This script obtains the current value of the page object property, substitutes it for the exltssion, and types it in the Script window.
The value of a text property is read and assigned to a string variable using the following syntax:
Read the current value of a text property and assign the value to a string variable:
%letter = objName.Property$;
For example, enter the following script in the Script window to assign the value of the text property of a text label to the %Z string variable:
%Z = objName.text$
Read the value of the text property in the Script Window:
%Z =
Use substitution notation to return the value of a text property:
type -b "The property is %Z";