Difference between revisions of "Category:Functions"
From SphereWiki
(→Properties and Functions) |
(→Properties and Functions) |
||
Line 35: | Line 35: | ||
| [[QVAL]] '' condition '' ? '' block1'' : '' block2 '' || || Execute block 1 if condition is true, otherwise block2. | | [[QVAL]] '' condition '' ? '' block1'' : '' block2 '' || || Execute block 1 if condition is true, otherwise block2. | ||
Note that it must be written inline : ''<qval condition ? true : false>''. | Note that it must be written inline : ''<qval condition ? true : false>''. | ||
− | There is another variant of QVAL in the | + | There is another variant of QVAL in the [[Intrinsic_Functions|intrinsic functions]] category. |
|- | |- | ||
| [[RETURN]] ''value'' || W || Exits the function, passing ''value'' back to whatever called it (if the function was used as ''<FUNCTION>''. ''value'' can be either a string or numeric value. | | [[RETURN]] ''value'' || W || Exits the function, passing ''value'' back to whatever called it (if the function was used as ''<FUNCTION>''. ''value'' can be either a string or numeric value. |
Revision as of 15:42, 4 January 2013
References
The following references are available within function and trigger scripts. If an attempt is made to access a reference that is not listed here then the object the function/trigger is called on will be accessed instead.
Name | Read/Write | Description |
ARGO | RW | Gets or sets a reference to a character or item. |
REFx | RW | Gets or sets a reference to a character or item. |
Properties and Functions
The following properties and functions are available within function and trigger scripts. If an attempt is made to access a property or function that is not listed here then the object the function/trigger is called on will be accessed instead.
Name | Read/Write | Description |
ARGN1 | RW | Gets the first parameter passed into the function, as a numeric value. |
ARGN2 | RW | Gets the second parameter passed into the function, as a numeric value. |
ARGN3 | RW | Gets the third parameter passed into the function, as a numeric value. |
ARGS | RW | Gets the entire argument string passed into the function. |
ARGV | R | Returns the number of parameters passed into the function. |
ARGV[n] | R | Returns the nth parameter passed into the function. (zero-based) |
FLOAT.name | RW | Gets or sets the value of a local floating point variable. |
LOCAL.name | RW | Gets or sets the value of a local variable. |
QVAL condition ? block1 : block2 | Execute block 1 if condition is true, otherwise block2.
Note that it must be written inline : <qval condition ? true : false>. There is another variant of QVAL in the intrinsic functions category. | |
RETURN value | W | Exits the function, passing value back to whatever called it (if the function was used as <FUNCTION>. value can be either a string or numeric value. |
TRY command | W | Executes command. |
TRYSRV command | W | Executes command, with the SERV object as SRC. |
This category currently contains no pages or media.