Difference between revisions of "Command/doif..."

From Wiki
Jump to navigation Jump to search
m (Text replace - "Reference/en|" to "Commands|")
Line 19: Line 19:
 
[http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions branches and decisions]
 
[http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions branches and decisions]
  
[[Category:Reference/en|doif...]]
+
[[Category:Commands|doif...]]

Revision as of 23:52, 13 March 2012

\doif...

Block of code depending on a Lua value - example (by WS, 3/2011):

\starttext
  \ctxlua{test = true}
 
  Test is \ctxlua{commands.testcase(test)}{True}{False}.
 
  \ctxlua{test = false}

  Test is \ctxlua{commands.testcase(test)}{True}{False}.
\stoptext

See also

branches and decisions