Difference: VarGET (1 vs. 4)
|
META TOPICPARENT |
name="TWikiVariables" |
GET{"name"} -- get a variable
- Get the value of a named variable, previously set with
%SET{}% . The %SET{}% and %GET{}% variables are handled by the SetGetPlugin.
- Syntax:
%GET{ "name" default="..." }%
|
|
< < | |
> > | |
|
"name" |
Name of variable. |
(required) |
|
|
< < |
default="..." |
Text shown if variable is not found. |
"" (empty string) |
|
> > |
format="..." |
Format with supported variables: • $name for variable name • $value for variable value • $isdefined expanding to 1 or 0 depending if variable is defined or not • $isset expanding to 1 or 0 depending if variable is logically true or false • $ispersistent expanding to 1 or 0 depending if variable is persistent or not • all FormatTokens such as $dollar , $n , $percnt . |
"$value" |
default="..." |
Text shown if variable is not defined, e.g. not found. This parameter overrides the format parameter. |
"" (empty string) |
|
|
- Example:
%GET{"lunch"}% returns Sushi if the following has been previously set: %SET{ "lunch" value="Sushi" }% - see more examples
|
|
> > | |
| |
|
META TOPICPARENT |
name="TWikiVariables" |
GET{"name"} -- get a variable |
|
Attribute |
Comment |
Default |
"name" |
Name of variable. |
(required) |
default="..." |
Text shown if variable is not found. |
"" (empty string) |
|
|
< < |
- Example:
%GET{"lunch"}% returns Sushi if the following has been previously set: %SET{ "lunch" value="Sushi" default="undecided" }% - see more examples
|
> > |
- Example:
%GET{"lunch"}% returns Sushi if the following has been previously set: %SET{ "lunch" value="Sushi" }% - see more examples
|
| |
|
META TOPICPARENT |
name="TWikiVariables" |
GET{"name"} -- get a variable |
|
"name" |
Name of variable. |
(required) |
default="..." |
Text shown if variable is not found. |
"" (empty string) |
- Example:
%GET{"lunch"}% returns Sushi if the following has been previously set: %SET{ "lunch" value="Sushi" default="undecided" }% - see more examples
|
|
< < | |
> > | |
|
> > |
META TOPICPARENT |
name="TWikiVariables" |
GET{"name"} -- get a variable
- Get the value of a named variable, previously set with
%SET{}% . The %SET{}% and %GET{}% variables are handled by the SetGetPlugin.
- Syntax:
%GET{ "name" default="..." }%
- Supported attributes:
Attribute | Comment | Default | "name" | Name of variable. | (required) | default="..." | Text shown if variable is not found. | "" (empty string) |
- Example:
%GET{"lunch"}% returns Sushi if the following has been previously set: %SET{ "lunch" value="Sushi" default="undecided" }% - see more examples
- Related: IF, SET, SetGetPlugin, SpreadSheetPlugin#FuncGET
|
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria?
Send feedback Note: Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.VarGET.