(1 vs. 5) VarGET < TWiki < TWiki

Home - this site is powered by TWiki(R)
TWiki  VarGET (1 vs. 5)

Welcome | Register | Changes | Topics | Index | Search | Go

 <<O>>  Difference Topic VarGET (5 - 2015-07-09 - TWikiContributor)
 
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="..." }%
  • Parameters:
    Parameter Description Default
Changed:
<
<
"name" Name of variable. (required)
>
>
"name" Name of variable, such as menu. May optionally contain a JSON path, such as menu.File.Open. (required)
 
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)
Added:
>
>
store="..." Specify a store name that holds the persistent variable. This assumes the variable was previously set with the same store name. ""
 
  • Example: %GET{"lunch"}% returns Sushi if the following has been previously set:
    %SET{ "lunch" value="Sushi" }% - see more examples
Added:
>
>
  • JSON Syntax: %GET{ name }% - see description.
  • Example to set a JSON object and to get a JSON object with a JSON path:
    • %SET{ menu = { "File": { "New": [ "new", "F" ], "Open": [ "open", "F" ] }, "Edit": { "Copy": [ "cpy", "F" ], "Paste": [ "pst", "F" ] } } }% - set a JSON object
    • %GET{ menu.File.Open }% - returns: ["open","F"]
 

 <<O>>  Difference Topic VarGET (4 - 2012-11-13 - TWikiContributor)
 
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="..." }%
Changed:
<
<
>
>
 
"name" Name of variable. (required)
Changed:
<
<
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"
Added:
>
>
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
Added:
>
>
 

 <<O>>  Difference Topic VarGET (3 - 2012-04-18 - TWikiContributor)
 
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)
Changed:
<
<
  • 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
 

 <<O>>  Difference Topic VarGET (2 - 2012-01-06 - TWikiContributor)
 
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
Changed:
<
<
>
>
 

 <<O>>  Difference Topic VarGET (1 - 2011-04-04 - TWikiContributor)
 
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

View | History: r5 < r4 < r3 < r2 | More

This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.VarGET.

Revision r5 - 2015-07-09 - 23:59:27 - TWikiContributor Edit

(%REVTITLE2% vs. %REVTITLE1%) VarGET < TWiki < TWiki