/* demonstrate control character usage Read a text file, whose name is specified at run time. print each line, unless it is ".narrow" or ".wide", which mean to set the character spacing on the TI printer. File 2 is created with SID or DDT, and contains the escape sequences needed to change the character width on the printer. Field 2,1 is escape-6, which sets the 10 character per inch width. Field 2,2 is escape-7, which sets 16.5 characters per inch. */ "",v,120,'.narrow' "",v,120,'.wide' input ( ?text.txt, text; /* user enters name of text file */ control, control /* our prepared control file */ ) output () read 2; /* first time, read the control chars */ loop: switch 1,1 case 0,1: /* set narrow width */ print at(0) 2,2; /* at(0) to avoid crlf */ break; case 0,2: /* set wide width */ print at(0) 2,1; break; default: print 1,1; endswitch read 1; if end 1 stop; endif goto loop; end;