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

From Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
See [http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions]
 
See [http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions]
 +
 +
Block of code depending on a Lua value - example (by WS, 3/2011):
 +
 +
<texcode>
 +
\starttext
 +
  \ctxlua{test = true}
 +
 +
  Test is \ctxlua{commands.testcase(test)}{True}{False}.
 +
 +
  \ctxlua{test = false}
 +
 +
  Test is \ctxlua{commands.testcase(test)}{True}{False}.
 +
\stoptext
 +
</texcode>

Revision as of 13:32, 25 March 2011

See [1]

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