Field Target References: Difference between revisions
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
:{| class="infotable" | :{| class="infotable" | ||
|class="leftnormal"| | |class="leftnormal"|value | ||
|(Left, Right, | |(Left, Right, Number) Accesses the contents of the field as a numeric value. If the field is text and the contents retrieved, the contents are automatically converted to a suitable value.<br> | ||
Example: result = this.field[myfield].value<br> | |||
Example: this.field[myfield].value = 42 | |||
|- | |- | ||
| | |text | ||
|(Left, Right, | |(Left, Right, String) Accesses the contents of the field as a string. If the field is numeric can the contents retrieved, the contents are automatically converted to a suitable string.<br> | ||
Example: result = this.field[myfield].text<br> | |||
Example: this.field[myfield].text = "hello" | |||
|- | |- | ||
|isempty | |isempty | ||
|(Right, Number) | |(Right, Number) Returns non-zero if the field contains the empty string and zero if it contains text of any length. If used on a numeric field or with an array or matrix, an error is reported. Testing of array and matrix elements must be done via the "compare" intrinsic.<br> | ||
Example: result = this.field[myfield].isempty | |||
|- | |- | ||
|reset | |reset | ||
|(Right, Number) | |(Right, Number) The contents of the field are reset to the initial default value for the thing. A value of zero is always returned.<br> | ||
Example: perform this.field[myfield].reset | |||
|- | |- | ||
|ischosen | |ischosen | ||
|(Right, Number) | |(Right, Number) Returns non-zero if the field contains a pick or a thing that was selected via a menu. If the field is associated with a menu and no selection has yet been made, zero is returned.<br> | ||
Example: result = this.field[myfield].ischosen | |||
|- | |- | ||
|delta | |delta | ||
|(Left, Right, Number) | |(Left, Right, Number) Accesses the delta component of a user field for manipulation separately from the user-specified value. The field must be explicitly configured to support delta processing.<br> | ||
Example: result = this.field[myfield].delta<br> | |||
Example: this.field[myfield].delta = 2 | |||
|- | |- | ||
|arrayvalue[''row''] | |arrayvalue[''row''] |
Revision as of 03:19, 7 December 2008
Context: HL Kit … Kit Reference … Target References
There are a variety of ways to access and manipulate the contents of fields. The complete list of target references for fields is presented in the table below.
NOTE! When a field is accessed from within a thing or a visual script, all operations are restricted to read-only behavior. Any attempts to modify a field from within a thing context or via a visual script will fail.
value (Left, Right, Number) Accesses the contents of the field as a numeric value. If the field is text and the contents retrieved, the contents are automatically converted to a suitable value.
Example: result = this.field[myfield].value
Example: this.field[myfield].value = 42text (Left, Right, String) Accesses the contents of the field as a string. If the field is numeric can the contents retrieved, the contents are automatically converted to a suitable string.
Example: result = this.field[myfield].text
Example: this.field[myfield].text = "hello"isempty (Right, Number) Returns non-zero if the field contains the empty string and zero if it contains text of any length. If used on a numeric field or with an array or matrix, an error is reported. Testing of array and matrix elements must be done via the "compare" intrinsic.
Example: result = this.field[myfield].isempty
reset (Right, Number) The contents of the field are reset to the initial default value for the thing. A value of zero is always returned.
Example: perform this.field[myfield].reset
ischosen (Right, Number) Returns non-zero if the field contains a pick or a thing that was selected via a menu. If the field is associated with a menu and no selection has yet been made, zero is returned.
Example: result = this.field[myfield].ischosen
delta (Left, Right, Number) Accesses the delta component of a user field for manipulation separately from the user-specified value. The field must be explicitly configured to support delta processing.
Example: result = this.field[myfield].delta
Example: this.field[myfield].delta = 2arrayvalue[row] (Left, Right, Number) arraytext[row] (Left, Right, Number) matrixvalue[row,col] (Left, Right, Number) matrixtext[row,col] (Left, Right, String) arraydump (Right, String) matrixdump (Right, String) modify[oper,val,str] (Right, Number) history[spl] (Right, String)