\documentstyle[select]{article} \def\selection{%%% you may use \renewcommand{\selection}{... as well \typeout{***********************************} \typeout{* Example of fairy tale selection *} \typeout{***********************************} \typeout{} \typein[\name]{Please enter your name:\space} \writedef{\name} \typeout{} \typeout{Select the fairy tale to be printed} \typeout{0=Cinderella} \typeout{1=Sleeping Beauty} \typeout{2=Snow White and Seven Dwarfs} \typeout{3=Little Red Riding-hood} \def\cz{0} \def\ci{1} \def\cii{2} \def\ciii{3} \newcount\fairytalectr \fairytalectr=100 \loop \ifnum \fairytalectr > 3 \typein[\choice]{Enter your choice [0..3]} \ifx\cz\choice \fairytalectr=0 \else \ifx\ci\choice \fairytalectr=1 \else \ifx\cii\choice \fairytalectr=2 \else \ifx\ciii\choice \fairytalectr=3 \fi \fi \fi \fi \repeat \writenewcnt{\fairytalectr} \ifcase \fairytalectr \def\choice{Cinderella} \or \def\choice{Sleeping Beauty} \or \def\choice{Snow White and Seven Dwarfs} \or \def\choice{Little Red Riding-hood} \fi \writedef{\choice} } \begin{document} \makeselection {\Large\it Dear \name} I am going to tell you the fairy tale called ``\choice''. \ifcase\fairytalectr Cinderella was sadly sitting above the dish full of flour mixed with ash. \or \ldots\ and Sleeping Beauty and the whole kingdom were sleeping in the roses. \or Snow White fell asleep in the Seven Dwarfs' beds. \or Once Little Red Riding-hood went to meet her grandmother and she met a wolf in the forest. \fi \end{document}