Difference between revisions of "Command/setvariables"

From Wiki
Jump to navigation Jump to search
(created page)
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Reference
 
{{Reference
|name=setupvariables
+
|name=setvariables
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setvariables</syntax>
 +
 +
== [[Help:Reference|Syntax]] ==
 +
 +
<syntax>setvariables</syntax>
  
 
== Description ==
 
== Description ==
  
Assign values to variables in a namespace. See [[Setups]].
+
Assign values to variables in a namespace. For exmaple, if you use:
 +
<texcode>
 +
\setvariables
 +
    [var]
 +
    [
 +
      a=1,
 +
      b=2,
 +
      c=3,
 +
    ]
 +
</texcode>
 +
 
 +
then, <code>\getvariable{var}{a}</code> returns <code>1</code>, etc.
 +
 +
 
 +
Also see [[Setups]].
  
 
== Example ==
 
== Example ==
Line 23: Line 44:
 
* {{cmd|getvariable}}
 
* {{cmd|getvariable}}
 
* {{cmd|setupvariables}}
 
* {{cmd|setupvariables}}
 +
  
 
== Help from ConTeXt-Mailinglist/Forum ==
 
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
{{Forum|setupvariables}}
+
{{Forum|setvariables}}
  
[[Category:Command|setupvariables]]
+
[[Category:Command/Variables|setvariables]]

Latest revision as of 20:42, 13 January 2020

\setvariables

Syntax (autogenerated)

\setvariables[...][...=...,...]
[...]name
setcommand
resetcommand
keyvalue


Syntax

\setvariables[...][...=...,...]
[...]name
setcommand
resetcommand
keyvalue


Description

Assign values to variables in a namespace. For exmaple, if you use:

\setvariables
    [var]
    [
      a=1,
      b=2,
      c=3,
    ]

then, \getvariable{var}{a} returns 1, etc.


Also see Setups.

Example

% \setups[namespace:set] is automatically called right after 'set' is assigned
\setvariables[namespace]
  [set={\setups[namespace:set]},
   key={Apples are \applecolor!},
   reset={\setups[namespace:reset]},
  ]
  

See also


Help from ConTeXt-Mailinglist/Forum

All issues with: