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

From Wiki
Jump to navigation Jump to search
(commands.testcase --> commands.doifelse)
(Add doifdocumentargument)
(One intermediate revision by the same user not shown)
Line 11: Line 11:
 
* <tt>\doifnumberelse</tt>
 
* <tt>\doifnumberelse</tt>
 
* <tt>\doifassignmentelse</tt>
 
* <tt>\doifassignmentelse</tt>
 
+
* <tt>\doifrightpageelse</tt> (precede by {{cmd|signalrightpage}})
<!--
+
* {{cmd|doifdocumentargument}}
* {{cmd|doifnextcharelse}}
 
* {{cmd|doifundefined}}, {{cmd|doifdefined}}, etc.
 
* {{cmd|doif}}, {{cmd|doifnot}}, {{cmd|doifelse}}
 
* {{cmd|doifempty}}, {{cmd|doifnotempty}}, {{cmd|doifemptyelse}}
 
* {{cmd|doifinset}}, {{cmd|doifnotinset}}, {{cmd|doifnotinsetelse}}
 
* {{cmd|doifcommon}}, {{cmd|doifnotcommon}}, {{cmd|doifcommonelse}}
 
* {{cmd|doifsamestringselse}},{{cmd|doifsamestring}},{{cmd|doifnotsamestring}}
 
* {{cmd|doifinstringelse}},{{cmd|doifincsnameelse}}
 
* {{cmd|doifnumberelse}}
 
* {{cmd|doifassignmentelse}}
 
-->
 
  
 
== Example ==
 
== Example ==

Revision as of 15:29, 10 September 2012

\doif...

  • \doifnextcharelse
  • \doifundefined, \doifdefined, etc.
  • \doif, \doifnot, \doifelse
  • \doifempty, \doifnotempty, \doifemptyelse
  • \doifinset, \doifnotinset, \doifnotinsetelse
  • \doifcommon, \doifnotcommon, \doifcommonelse
  • \doifsamestringselse,\doifsamestring,\doifnotsamestring
  • \doifinstringelse,\doifincsnameelse
  • \doifnumberelse
  • \doifassignmentelse
  • \doifrightpageelse (precede by \signalrightpage)
  • \doifdocumentargument

Example

We can also write tests using Lua. (Example by WS, 3/2011.)

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

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

See also

Branches and Decisions

Help from ConTeXt-Mailinglist/Forum

All issues with: