Open main menu
Wiki
Search
Changes
← Older edit
Newer edit →
Command/doif...
(view source)
Revision as of 15:29, 10 September 2012
701 bytes added
,
15:29, 10 September 2012
Add doifdocumentargument
{{Reference|name=doif...|attributes=}}
Block of code depending on a Lua value - example
* <tt>\doifnextcharelse</tt>
* <tt>\doifundefined</tt>, <tt>\doifdefined</tt>, etc.
* <tt>\doif</tt>, <tt>\doifnot</tt>, <tt>\doifelse</tt>
* <tt>\doifempty</tt>, <tt>\doifnotempty</tt>, <tt>\doifemptyelse</tt>
* <tt>\doifinset</tt>, <tt>\doifnotinset</tt>, <tt>\doifnotinsetelse</tt>
* <tt>\doifcommon</tt>, <tt>\doifnotcommon</tt>, <tt>\doifcommonelse</tt>
* <tt>\doifsamestringselse</tt>,<tt>\doifsamestring</tt>,<tt>\doifnotsamestring</tt>
* <tt>\doifinstringelse</tt>,<tt>\doifincsnameelse</tt>
* <tt>\doifnumberelse</tt>
* <tt>\doifassignmentelse</tt>
* <tt>\doifrightpageelse</tt>
(
precede
by
WS, 3/2011
{{cmd|signalrightpage}}
)
:
* {{cmd|doifdocumentargument}}
== Example ==
We can also write tests using Lua. (Example by WS, 3/2011.)
<
texcode
context mode="mkiv" source="yes"
>
\starttext
\ctxlua{test = true}
Test is \ctxlua{commands.
testcase
doifelse
(test)}{True}{False}.
\ctxlua{test = false}
Test is \ctxlua{commands.
testcase
doifelse
(test)}{True}{False}.
\stoptext
</
texcode
context
>
== See also ==
[
http:
[System Macros
/
/wiki.contextgarden.net/System_Macros/Branches_and_Decisions branches
Branches and Decisions|Branches
and
decisions
Decisions]
]
== Help from ConTeXt-
Mailinglist/
Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}
[[Category:
Commands
Command/Internals
|doif...]]
Esteis
Administrators
1,964
edits