|
|
Hitop Reference: VariablesSetting<@SET NAME="varname" ( [VALUE="value"] | [EXPR="expression"] [SCOPE="(LOCAL|PARENT|GLOBAL)"] [DEFAULT]> Sets the named variable to the value (or result of evaliating the expression) specified (or marks it as "existing" if no value or expression is given). The default scope is local&nsbp;- that is from the current procedure downwards. Parent scope sets it only in the calling environment, while global sets it in all parent scopes. If DEFAULT is given, the variable will only be set if it isn't already - effectively it allows you to give a default value for one not already specified. Getting<@GET ( NAME="varname" [FORMAT="commands"] | EXPR="expression" ) > Retrieves the string stored in the named variable. Variable contents can be retrieved for use in markup by using the form ${varname}. Variable names may be nested ${${var1}${var2}} or used as markup name <${var1}>. Attempting to retrieve the value of an undefined variable will give an error. This can be guarded by using <@IF> without a VALUE. The optional string processing commands can be appended to the variable name with a colon in either inline expansion or using <@GET>, or specified in FORMAT for <@GET>. String literals to be formatted may also be specified. For example: <@SET NAME="CAT" VALUE="aardvark"> The following variables are predefined but may be overloaded:
If EXPR is given, it simply returns the value of the mathematical expression given. Unsetting<@UNSET NAME="varname" [SCOPE="(LOCAL|PARENT|GLOBAL)"]> @UNSET does the same as @SET but removes the value given to a named variable. | |||||||||||||||||||||
|
Last updated 2001-06-16 |