<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I used  \doifmode and friends for selection of mode dependent code.<div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">dr. Hans van der Meer<br class=""><br class=""></div></div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 1 Mar 2019, at 01:24, Hans Hagen <<a href="mailto:j.hagen@xs4all.nl" class="">j.hagen@xs4all.nl</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 2/28/2019 11:29 AM, Procházka Lukáš Ing. wrote:<br class=""><blockquote type="cite" class="">Hello,<br class="">I'm struggling with using modes to make a part of the text conditional.<br class="">Here is my code:<br class="">----<br class="">\def\b#1{\startmode[#1]}<br class="">\def\e{\stopmode}<br class="">% \enablemode[100] % For optional usage<br class="">\starttext<br class="">   A<br class="">   \b{100} % Should be start of some conditional text from here ...<br class="">     B<br class="">   \e % ... to here<br class="">\stoptext<br class="">----<br class="">Compilation fails with:<br class="">"<br class="">tex error       > tex error on line 0 in file : ! Emergency stop<br class=""><*> cont-yes.mkiv<br class=""><empty file><br class="">*** (job aborted, no legal \end found)<br class="">"<br class="">How to make the sample work?<br class=""></blockquote>modes are like buffers ... don't wrap them in macros<br class=""><br class="">(using names like \b \e is a bad idea anyway)<br class=""><br class="">Hans<br class=""><br class=""><br class="">-----------------------------------------------------------------<br class="">                                          Hans Hagen | PRAGMA ADE<br class="">              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands<br class="">       tel: 038 477 53 69 | <a href="http://www.pragma-ade.nl" class="">www.pragma-ade.nl</a> | <a href="http://www.pragma-pod.nl" class="">www.pragma-pod.nl</a><br class="">-----------------------------------------------------------------<br class="">___________________________________________________________________________________<br class="">If your question is of interest to others as well, please add an entry to the Wiki!<br class=""><br class="">maillist : <a href="mailto:ntg-context@ntg.nl" class="">ntg-context@ntg.nl</a> / <a href="http://www.ntg.nl/mailman/listinfo/ntg-context" class="">http://www.ntg.nl/mailman/listinfo/ntg-context</a><br class="">webpage  : <a href="http://www.pragma-ade.nl" class="">http://www.pragma-ade.nl</a> / <a href="http://context.aanhet.net" class="">http://context.aanhet.net</a><br class="">archive  : <a href="https://bitbucket.org/phg/context-mirror/commits/" class="">https://bitbucket.org/phg/context-mirror/commits/</a><br class="">wiki     : <a href="http://contextgarden.net" class="">http://contextgarden.net</a><br class="">___________________________________________________________________________________<br class=""></div></div></blockquote></div><br class=""></div></body></html>