<div dir="ltr">
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin: 0px; text-indent: 0px;">\documentclass{article}</p>
<p style="margin: 0px; text-indent: 0px;">\newif\ifok</p>
<p style="margin: 0px; text-indent: 0px;">\newif\ifnotok</p>
<p style="margin: 0px; text-indent: 0px;">\newcommand{\printtest}{%</p>
<p style="margin: 0px; text-indent: 0px;">\csname ifok\endcsname\csname ifnotok\endcsname print test\fi\fi}</p>
<p style="margin: 0px; text-indent: 0px;">\begin{document}</p>
<p style="margin: 0px; text-indent: 0px;">This is a test</p>
<p style="margin: 0px; text-indent: 0px;">\printtest</p>
<p style="margin: 0px; text-indent: 0px;">\end{document}</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">Tex complains that there is an "Extra \fi", why?<br></p></div>