From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 15-SEP-1988 11:41
To:	ARISIA::EVERHART
Subj:	RNO-to-TeX (again)


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 15 SEP 88 07:07:18 PDT
Received: from relay.ubc.ca by KL.SRI.COM with TCP; Thu, 15 Sep 88 07:05:55 PDT
Received: by relay.ubc.ca (5.59/1.14)
	id AA00726; Thu, 15 Sep 88 07:00:58 PDT
Date: 15 Sep 88 13:41 -0500
From: John Edgecombe <edgecombe%ccrs.cdn@relay.ubc.ca>
To: <tnieland@wpafb-aamrl.arpa>, <philmds!philtis!lcn@mcvax.cwi.nl>,
        <info-vax@kl.sri.com>
Message-Id: <13*edgecombe@ccrs.cdn>
Subject: RNO-to-TeX (again)

I have been getting more messages recently about the .INI file missing
(including Ted Nieland's to the net).  Although I posted the revised
share files, the volume implies that I shall have to do so again.
So here goes -- in five parts:


+-+-+-+ Beginning of part 3 +-+-+-+
X       `009    number  : begin
X`009                atseparator := false;
V`009                startarg(currentchar, argread, [int,signedint,textpckstr,nu
Xlltype]);
X                        done := false;
X                        repeat
X`009                    getnextchar(infile, gotten);
X                            if gotten then                                    
X`009                    begin
X`009                        if charclass(currentchar) = number then
X                                    appendchartoarg(currentchar, argread)
X                                else
X                                    done := true
X                            end
X`009                    else
X                            begin
X                                done := true;
X`009                        endofdsrcommand :=  true
X`009                    end
X`009                until done;
X`009                appendargonlist(list, argread )
X                     end;                                           
X`009 separator : begin                                        
X`009                passblanks(infile, outfile, dontwritethem);
X`009                if (atseparator) and (currentchar <> lastinputchar) then
X`009                begin
X`009                    startarg(blank, argread, [nulltype]);
X`009                    appendargonlist(list, argread);
X                            atseparator := false
X`009                end
X`009                else
X`009                begin
X                            if flagclass(currentchar) = control then
X`009                      endofdsrcommand := true
X                            else
X                              if charclass(currentchar) = separator then
X                              begin
X                                getnextchar(infile, gotten);
X`009                        if gotten then
X                                   atseparator := true
X`009                        else
X                                begin
X                                   atseparator := false;
X`009                           startarg(blank, argread, [nulltype]);
X`009                           appendargonlist(list, argread);
X`009                           endofdsrcommand := true         
X                                end
X                              end
X`009                end
V`009             end;                                                          
X   
X`009semicolon : begin
X                       endofdsrcommand := true;
X`009               getnextchar(infile, gotten);
X`009               if charclass(currentchar) = newdsrcommand then
X`009                  currentargclass := newdsrcommand
X`009               else
X`009               begin
X`009                 carrychar := true;
X`009                 charcarried := currentchar
X`009               end
X`009             end;
X`009    quote  : begin       
X`009                quotedchar := currentchar;
X`009                getnextchar(infile, gotten);
X                        if gotten then
X`009                begin
X`009                   startarg(currentchar, argread, [quotedpckstr]);
X`009                   done := false;
X`009                   repeat
X`009                      getnextchar(infile, gotten);
X`009                      if gotten then
X`009                      begin
X`009                        if charclass(currentchar) = quote then
X`009                        begin
X`009                            getnextchar(infile, gotten);
X`009                            done := true;
X`009                            if not gotten then
X`009                                endofdsrcommand := true
X`009                        end
X`009                        else
X`009                            appendchartoarg(currentchar, argread)
X`009                      end                                              
X                              else
X`009                      begin
X`009                        endofdsrcommand := true;
X`009                        done := true
X`009                      end
X`009                   until done
X`009                end
X`009                else                                           
X`009                  startarg(quotedchar, argread,[textpckstr,character]);
X                        appendargonlist(list, argread)
X                     end;
X      commentchar : begin
X`009               endofdsrcommand := true
X                     end;
X   newdsrcommand : begin
X                       endofdsrcommand := true;  
X                     end
X      end; {case}
X    until endofdsrcommand;                    
X    if currentargclass <> newdsrcommand then
X      newline( infile, outfile, false)           
X    else
X      anothercommand := true
Xend;
X`009                               
X      
X                                     
XPROCEDURE parsefile( var infile, outfile : text; textree : argtree );
Xconst                 
X   nocrlf = false;
X   putcrlf = true;                              
Xvar
X   dsrcommandfound      : boolean;
X   chargotten            : boolean;
X   dsrarguments          : arglist;
X   texcommandindex      : integer;
X   nextcommandtowrite  : integer;                             
X   successfulparse       : boolean;
X   depthofsearch        : integer;                                         
X   anothercommand        : boolean;
X   carrychar             : boolean;
X   charcarried, copychar : char;
Xbegin     
X  ttywritestring('Translating input ...');                         
X  totalgooddsrcommands := 0;
X  totalbaddsrcommands := 0;
X  nextcommandtowrite := indexofunknowntexcommand;
X  anothercommand := false;
X  repeat                                    
X    putsecondarytexcommand( outfile, nextcommandtowrite);
X    repeat
X      checkfordsrcommand( infile, outfile, dsrcommandfound );
X      if dsrcommandfound then
X      begin
V        parsedsrcommand( infile, outfile, dsrarguments, anothercommand,carrycha
Xr,charcarried);
X        if listispagecommand( dsrarguments) then
X        begin
X          successfulparse := true;
X          texcommandindex := indexofpagecommand
X        end
X        else
V          searchtreeforlist( textree, dsrarguments,successfulparse, texcommandi
Xndex,
X          depthofsearch);            
X        if successfulparse then
X        begin
X          totalgooddsrcommands := totalgooddsrcommands + 1;
V          puttexcommand(outfile, texcommandindex, dsrarguments, nextcommandtowr
Xite);
X          if carrychar then
X          begin
X`009     copychar := currentchar;
X`009     currentchar := charcarried;
X`009     writecurrentchar( infile, outfile );
X`009     currentchar := copychar
X          end
X        end
X        else
X        begin
X          totalbaddsrcommands := totalbaddsrcommands + 1;
X          write(outfile,'%Unidentified RUNOFF command "');
X          dumpthelist(outfile, dsrarguments);
X          writeln(outfile,'"')
X        end
X      end
X      else
X        anothercommand := false
X    until (not dsrcommandfound) and (not anothercommand);
X    repeat
X      writecurrentchar( infile, outfile );
X      getnextchar(infile, chargotten)
X    until not chargotten;
X    newline(infile, outfile, putcrlf)
X  until eof(infile)
Xend;
X
X
X
XEND.
X                                                   
X                                                                        
$ GOSUB UNPACK_FILE
$ FILE_IS = "FLAGOPS.PAS"
$ CHECKSUM_IS = 125287985
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X[INHERIT('UTILITYOPS','ARGOPS')]
X
XMODULE FLAGOPS;          
X
XCONST
X
X  tab = 9;
X  ncharsintab = 8;
X
XTYPE
X                     
Xdsrflagtype = record
X`009            representation : char;
X`009            turnedon : boolean
X `009        end;
X                     
X                                 
Xdsrflagclasses = (notaflag, control, uppercase, lowercase, quote,
Xspace, underline, bold, overstrike, hyphenate, break, period, capitalize,
Xendfootnote, comment, substitute);
X
Xflagtabletype = array[dsrflagclasses] of dsrflagtype;
X
Xtabrecordtype = record
X`009            tabread : boolean;
X`009            charcountintab : integer
X`009          end;
X
Xstyletype = (undetermined, decimal, octal, hexidecimal, romanupper, romanlower,
X`009    romanmixed, letterupper, letterlower, lettermixed, nostyle);
X
Xenhancmentstates = (notenhanced, singlecharenhanced, enhancmentlocked);
X    
X
X
XVAR                                 
X
X`009lastinputchar, currentchar   : [EXTERNAL] char;
X        capitalizetext, lowercasetext : [EXTERNAL] boolean;
X`009inputcontainstexcommands     : [EXTERNAL] boolean;
X        inliteral                      : [EXTERNAL] boolean;
X        totallines, totalchars        : [EXTERNAL] integer; 
X        flagtable                      : [EXTERNAL] flagtabletype;
X        tabrecord                      : [EXTERNAL] tabrecordtype;
X`009LOG                             : [EXTERNAL] text;    
X        columncounter                  : [EXTERNAL] integer;
X`009infootnote                     : [EXTERNAL] boolean; 
X`009boldactive                     : [EXTERNAL] enhancmentstates;
X        underlineactive                : [EXTERNAL] enhancmentstates;
X        startnofillagain             : [EXTERNAL] boolean;   
X        fill                            : [EXTERNAL] boolean;
X        listnestlevel                 : [EXTERNAL] integer;
X
X      
X
X[GLOBAL] PROCEDURE beginnofill( var outfile : text  );
Xbegin              
X  if (fill) and (listnestlevel = 0) then
X  begin
X     writeln(outfile,'{\obeylines \obeyspaces % -  begin no fill');
X     fill := false
X  end
X  else
X  begin
X    writeln(outfile,'% - RNOTOTEX obeylines, obeyspaces already active');
X    writeln(    log,'% - RNOTOTEX obeylines, obeyspaces already active')
X  end
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE endnofill( var outfile : text );
Xbegin
X   if (not fill) and (listnestlevel = 0) then
X   begin
X      writeln(outfile,'} % - end of no fill');    
X      fill := true
X   end
X   else                                      
X   begin
X      writeln(outfile,'% - RNOTOTEX obeylines, obeyspaces not active');
X      writeln(    log,'% - RNOTOTEX obeylines, obeyspaces not active')
X   end
Xend;
X
X
X
X
X
X        
X[GLOBAL] PROCEDURE writeflagname( var outfile : text; f : dsrflagclasses );
Xbegin          
X  case f of
X    notaflag   : write(outfile,'?????');
X    control      : write(outfile,'CONTROL');
X    uppercase    : write(outfile,'UPPERCASE');
X    lowercase    : write(outfile,'LOWERCASE');
X    quote        : write(outfile,'QUOTE');
X    space        : write(outfile,'SPACE');
X    underline    : write(outfile,'UNDERLINE');
X    bold         : write(outfile,'BOLD');
X    overstrike   : write(outfile,'OVERSTRIKE');
X    hyphenate    : write(outfile,'HYPYENATE');
X    capitalize   : write(outfile,'CAPITALIZE');
X    endfootnote : write(outfile,'END FOOTNOTE');
X    comment      : write(outfile,'COMMENT');
X    substitute   : write(outfile,'SUBSTITUTE')
X  end
Xend;
X
X
X
X                   
X
X 
X[GLOBAL] FUNCTION isastylespecifier( arg : argument ) : styletype;
Xlabel
X   routineexit;
Xvar 
X  s : pckstr;
X  classification : styletype; 
Xbegin        
X   s := argliteral( arg, TRUE );
X   classification := undetermined;
X   if (s.body[1] = 'D') and (s.length = 1) then
X   begin
X     classification := decimal;
X     goto routineexit
X   end;
X   if (s.body[1] = 'O') and (s.length = 1) then
X   begin
X     classification := octal;            
X     goto routineexit
X   end;
X   if (s.body[1] = 'H') and (s.length = 1) then
X   begin
X     classification := hexidecimal;
X     goto routineexit
X   end;
X   if (s.body = 'RU') and (s.length = 2) then
X   begin
X     classification := romanupper;
X     goto routineexit
X   end;
X   if (s.body = 'RL') and (s.length = 2) then
X   begin
X     classification := romanlower;
X     goto routineexit
X   end;
X   if (s.body = 'RM') and (s.length = 2) then
X   begin
X     classification := romanmixed;                           
X     goto routineexit
X   end;
X   if (s.body = 'LU') and (s.length = 2) then
X   begin
X     classification := letterupper;
X     goto routineexit
X   end;
X   if (s.body = 'LL') and (s.length = 2) then
X   begin
X     classification := letterlower;
X     goto routineexit
X   end;
X   if (s.body = 'LM') and (s.length = 2) then
X   begin
X     classification := lettermixed;
X     goto routineexit
X   end;                         
X   routineexit : isastylespecifier := classification
Xend;
X                                
X
X
X[GLOBAL] PROCEDURE initflagtable;
Xvar
X  f : dsrflagclasses;
Xbegin
X  for f := notaflag to substitute do
X  case f of
X       `009notaflag : begin
X`009              flagtable[f].representation := blank;
X`009              flagtable[f].turnedon := false
X`009             end;
X `009control    : begin
X`009              flagtable[f].representation := '.';   
X`009              flagtable[f].turnedon := true
X`009             end;
X `009uppercase  : begin
X`009              flagtable[f].representation := '^';
X`009              flagtable[f].turnedon := true
X`009             end;
X `009lowercase  : begin
X`009              flagtable[f].representation := '\';   
X`009              flagtable[f].turnedon := true
X`009             end;
X `009quote      : begin
X`009              flagtable[f].representation := '_';  
X`009              flagtable[f].turnedon := true
X`009             end;
X `009space      : begin
X`009              flagtable[f].representation := '#';  
X`009              flagtable[f].turnedon := true 
X`009             end;
X `009underline  : begin
X`009              flagtable[f].representation := '&';  
X`009              flagtable[f].turnedon := true 
X`009             end;
X `009bold       : begin
X`009              flagtable[f].representation := '*';  
X`009              flagtable[f].turnedon := false
X`009             end;
X `009overstrike : begin
X`009              flagtable[f].representation := '%';  
X`009              flagtable[f].turnedon := false
X`009             end;
X       `009hyphenate  : begin
X`009              flagtable[f].representation := '=';  
X`009              flagtable[f].turnedon := false
X`009             end;
X       `009break      : begin
X`009              flagtable[f].representation := '|';  
X`009              flagtable[f].turnedon := false
X`009             end;
X       `009period     : begin
X`009              flagtable[f].representation := '+';  
X`009              flagtable[f].turnedon := false
X`009             end;
X       `009capitalize : begin
X`009              flagtable[f].representation := '<';  
X`009              flagtable[f].turnedon := false
X`009             end;
X      endfootnote : begin
X                       flagtable[f].representation := '!';
X`009               flagtable[f].turnedon := false
X`009             end;
X       `009comment    : begin
X`009              flagtable[f].representation := '!';  
X`009              flagtable[f].turnedon := true
X`009             end;
X       `009substitute : begin
X`009              flagtable[f].representation := '$';  
X`009              flagtable[f].turnedon := false
X`009             end
X  end { case }
Xend; {initflagtable}   
X
X
X
X
X[GLOBAL] FUNCTION flagclass( ch : char )  : dsrflagclasses;
Xvar
X   class : dsrflagclasses;
X   foundclass : boolean;
Xbegin     
X   class := control;
X   foundclass := false;
X   while (class <> substitute) and ( not foundclass) do
V     if (ch = flagtable[class].representation) and (flagtable[class].turnedon)t
Xhen
X        foundclass := true
X     else                   
X        class := succ(class);
X   if foundclass then       
X     if inliteral then
X`009if class = control then
X`009  flagclass := control
X`009else
X`009  flagclass := notaflag
X      else
X        flagclass := class
X   else
X     flagclass := notaflag
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE initcharreader(var f : text );
Xbegin
X   reset(f);
X   lastinputchar := blank;
X   read(f, currentchar);
X   totallines := 0;
X   totalchars := 0;       
X   columncounter := 1;
X   if ord(currentchar) = tab then
X   begin
X     tabrecord.tabread := true;
X     tabrecord.charcountintab := ncharsintab
X   end
X   else
X   begin
X     tabrecord.tabread := false;
X     tabrecord.charcountintab := 0
X   end
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE getnextchar( var f : text; var gotten : boolean );
X
X  function nexttabcolumn( startingcolumn : integer ) : integer;
X  var
X    i : integer;
X  begin
X    i := startingcolumn;
X    repeat               
X       i := i + 1
X    until (i-1) mod ncharsintab = 0;
X    nexttabcolumn := i;
X    writeln(log,'nexttabcolumn input = ',startingcolumn:1,', output = ',i:1)
X  end;
X  
Xbegin
X   gotten := false;
X   if NOT eof(f) then
X   if NOT eoln(f) then
X     with tabrecord do
X    
X        lastinputchar := currentchar;
X        gotten := true;
X        columncounter := columncounter + 1;
X        if (tabread) and (charcountintab > 0) then
X        begin
X`009   currentchar := blank;
X`009   charcountintab := charcountintab - 1;
X`009   if charcountintab = 0 then tabread := false
X`009end                            
X`009else
X`009begin
X          totalchars := totalchars + 1;
X          read( f, currentchar );
X          if currentchar < blank then
X          begin
X             if ord(currentchar) = tab then
X             begin
X               tabread := true;
V               charcountintab := nexttabcolumn( columncounter ) - columncounter
X-1;
X               writeln(log,'charcountintab = ',charcountintab)
X             end;
X`009     currentchar := blank
X         end 
X        end
X     end
Xend;                    
X
X
X
V[GLOBAL] PROCEDURE startunderline( var outfile : text; class : enhancmentstates
X);
Xbegin 
X  if class <> notenhanced then
X    case underlineactive of
X      notenhanced         : begin
X`009                       write(outfile,'\underline{');
X`009                       underlineactive := class
X`009                    end;
X      singlecharenhanced : nullstatement;
X      enhancmentlocked   : nullstatement
X    end;
X  underlineactive := class
Xend;                                             
X
X
X
X
X[GLOBAL] PROCEDURE stopunderline( var outfile : text );
Xbegin
X  case underlineactive of
X    notenhanced             : nullstatement;
X    singlecharenhanced     : begin
X`009                         write(outfile,'} ');
X`009                         underlineactive := notenhanced
X`009                       end;
X    enhancmentlocked        : nullstatement
X  end
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE startbold( var outfile : text; class : enhancmentstates);
Xbegin                 
X  if class <> notenhanced then
X    case boldactive of
X      notenhanced         : begin
X`009                       write(outfile,'{\bf ');
X`009                       boldactive := class
X`009                    end;
X      singlecharenhanced : nullstatement;
X      enhancmentlocked    : nullstatement
X    end;
X  boldactive := class
Xend;                                             
X                             
X
X
X
X[GLOBAL] PROCEDURE stopbold( var outfile : text );
Xbegin
X   case boldactive of
X     notenhanced           : nullstatement;
X     singlecharenhanced   : begin
X`009                         write(outfile,'} ');
X`009                         boldactive := notenhanced
X`009                      end;
X     enhancmentlocked      : nullstatement
X   end
Xend;
X                                                  
X
X
X
X                            
V[GLOBAL] PROCEDURE passblanks( var infile, outfile : text; writethem : boolean 
X);
Xvar 
X   gotten, keeppassing : boolean;
Xbegin                  
X   keeppassing := true;    
X   gotten := true;
X   repeat
X      if (currentchar = blank) and (gotten) then
X      begin
X         if writethem then write(outfile, blank );
X         getnextchar(infile, gotten)
X      end
X      else
X         keeppassing := false
X   until NOT keeppassing                                  
Xend;
X          
X                            
X
X[GLOBAL] PROCEDURE texwrite( var f : text; ch : char );
Xconst         
X  maxtrys = 2;
Xvar
X  ntrys : integer;
X  written : boolean;
Xbegin          
X   ntrys := 0;     
X   written := false;
X   repeat
X     if (inputcontainstexcommands) or (inliteral) then
X       write(f, ch, error := continue)
X     else
X       if ch >= blank then
X        if ch in ['#','$','%','&','_','^','{','}','~'] then
X           write(f, '\',ch, error := continue)
X        else
X           if ch = '\' then
X              write(f,'\backslash ', error := continue)
X           else
X              write(f, ch, error := continue);
X     if status(f) > 0 then
X     begin
X       writeln(f, error := continue); 
X       ntrys := ntrys + 1
X     end
X     else
X       written := true     
X   until (written) or (ntrys > maxtrys);
X   if ntrys > maxtrys then
X       errorexit('TEXWRITE','error writing to output')
Xend;
X
X
X
X[GLOBAL] PROCEDURE writecurrentchar( var infile, outfile : text );
Xvar
X   gotten : boolean;
Xbegin                                
X    if capitalizetext then
X       currentchar := capchar( currentchar );
X    if lowercasetext then
X       currentchar := lcchar( currentchar );
X    case flagclass(currentchar) of              
X        notaflag   : begin                   
X`009                  stopunderline( outfile );
X`009                  stopbold( outfile );
X`009                  texwrite(outfile, currentchar)
X                       end;
X`009control      : begin                              
X`009                  stopunderline( outfile );           
X`009                  stopbold( outfile );                      
X`009                  texwrite(outfile, currentchar)
X                       end;
X `009uppercase    : begin
X                       getnextchar(infile, gotten);
X                       if gotten then
X                       case flagclass(currentchar) of        
X`009`009         underline  : startunderline( outfile, enhancmentlocked);
X`009                 bold       : startbold( outfile, enhancmentlocked );
X                         otherwise    texwrite(outfile, capchar(currentchar))
X                       end
X`009               end;
X `009lowercase    : begin                                   
X                       getnextchar(infile, gotten);
X                       if gotten then
X`009               case flagclass(currentchar) of
X`009`009         underline  : begin
X`009                                if underlineactive <> notenhanced then 
X`009                                   write(outfile,'} ');
X`009                                underlineactive := notenhanced
X`009                              end;
X`009                 bold       : begin
X                                        if boldactive <> notenhanced then
X `009                                   write(outfile,'} ');
X`009                                boldactive := notenhanced
X`009                              end;
X                         otherwise    texwrite(outfile, lcchar(currentchar))
X                         end
X`009               end;                   
X `009quote        : begin
X`009               getnextchar(infile, gotten);
X                       if gotten then      
X`009                texwrite(outfile, currentchar )
X`009              end;
X `009space        : write(outfile,'\ ');
X `009underline    : begin                              
X                       getnextchar(infile, gotten );
X                       if gotten then
X                       begin
X                         startunderline( outfile, singlecharenhanced);
X`009                 texwrite(outfile, currentchar)
X                       end
X`009               else
X`009                 texwrite(outfile, currentchar)
X                      end;
X `009bold         : begin
X`009                getnextchar(infile, gotten);
X                        if gotten then
X                        begin
X                           startbold( outfile, singlecharenhanced);
X`009                   texwrite(outfile, currentchar)
X`009                end
X`009                else
X`009                  texwrite(outfile, currentchar)
X`009               end;
X `009overstrike   : begin
X`009                 getnextchar(infile, gotten);
X                         if gotten then
X                         begin
X`009                   startbold( outfile, singlecharenhanced);
X`009                   texwrite(outfile, currentchar)
X`009                 end
X`009                 else
X`009                   texwrite(outfile, currentchar)
X`009               end;
X       `009hyphenate    : write(outfile,'--');
X       `009break        : writeln(outfile,'\linebreak');
X       `009period       : write(outfile,'\nonfrenchspacing ');
X       `009capitalize   : begin
X`009                 getnextchar( infile, gotten);
X`009                 if gotten then
X`009                    texwrite(outfile, capchar(currentchar))
X`009               end;  
X        endfootnote : begin
X`009                if (columncounter = 1) and (infootnote) then
X`009                begin
X                            if not fill then
X`009                       endnofill( outfile );
X`009  `009            writeln(outfile,'} % - end of footnote');
X`009                    writeln(    log,'} % - end of footnote');
X                            infootnote := false;
X`009                    if startnofillagain then
X`009                    begin
X`009                       startnofillagain := false;
X`009                       beginnofill( outfile )
X`009                    end
X`009                end                                         
X`009                else
X`009                    texwrite(outfile, currentchar)
X`009               end;
X       `009comment    : begin
X                       if flagclass(lastinputchar) = control then
X`009                      write(outfile,'% ')
X                        else
X`009                   texwrite(outfile,currentchar)
X`009             end;
X       `009substitute : texwrite(outfile, currentchar)
X  end { case }
Xend;
X                                             
X
X                        
X
X[GLOBAL] PROCEDURE newline( var infile, outfile : text; putcrlf : boolean );
Xvar                                                               
X  gotten : boolean;
Xbegin                   
X   if eoln(infile) then 
X   begin
X     readln(infile);
X     totallines := totallines + 1;
X     columncounter := 1
X   end;
X   if putcrlf then 
X     writeln(outfile);
X   while (eoln(infile)) and (not eof(infile)) do
X   begin  
X     readln(infile);
X     writeln(outfile);  
X     columncounter := 1;                            
X     totallines := totallines + 1
X   end;                                      
X   if not eof(infile) then
X   begin 
X     read(infile, currentchar);       
X     totalchars := totalchars + 1;
X     lastinputchar := blank
X   end;                        
X   if ord(currentchar) = tab then
X   begin                                             
X      tabrecord.charcountintab := ncharsintab;
X      tabrecord.tabread := true
X   end
X   else
X   begin
X     tabrecord.charcountintab := 0;
X     tabrecord.tabread := false
X   end;
X   if currentchar < blank then currentchar := blank
Xend;
X
X
X
X
X
X
X[GLOBAL] PROCEDURE changeflagchar( flag : dsrflagclasses; newchar:char);
Xbegin
X   flagtable[flag].representation := newchar;
X   write(log,'[internal flag representation change for ');
X   writeflagname(log, flag);
X   writeln(log,' to "',newchar,'"]')
Xend;
X
X    
X
X[GLOBAL] PROCEDURE turnflagon( flag : dsrflagclasses );
Xbegin
X   flagtable[flag].turnedon := true;
X   write(log,'[internal flag ');
X   writeflagname(log, flag);
X   writeln(log,' enabled]')
Xend;
X                                    
X
X
X[GLOBAL] PROCEDURE turnflagoff( flag : dsrflagclasses );
Xbegin
X  flagtable[flag].turnedon := false;
X  write(log,'[internal flag ');
X  writeflagname(log, flag);
X  writeln(log,' disabled]')
Xend;
X
X
X
X
X[GLOBAL] PROCEDURE texwritearg( var outfile : text; arg : argument );
Xvar
X  s : pckstr;
X  i, l : integer;
Xbegin
X  s := argliteral( arg, false );
X  l := length( s );
X  for i := 1 to l do  texwrite(outfile, s.body[i]);
X  write(outfile, blank)
Xend;
X
X
XEND.                                                                
$ GOSUB UNPACK_FILE
$ FILE_IS = "GETCLI.FOR"
$ CHECKSUM_IS = 53499580
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X`009SUBROUTINE GETCLI (IFILE,OFILE,TEX)
X
X`009IMPLICIT NONE
X`009 
XC 
XC FUNCTIONAL DESCRIPTION:`009
XC 
XC    This routine gets the input and output file names for program
XC    RNOTOTEX.
XC 
XC DUMMY ARGUMENTS:
XC 
XC    none.
XC 
XC IMPLICIT INPUTS:
XC 
XC    none
XC 
XC IMPLICIT OUTPUTS:
XC 
X`009CHARACTER*(*) IFILE
XC`009INPUT FILE NAME
XC
X`009CHARACTER*(*) OFILE
XC`009OUTPUT FILE NAME
XC
X`009INTEGER TEX
XC `009TEX COMMANDS FLAG : 0 FOR NO, NOT 0 FOR YES
XC 
XC SIDE EFFECTS:
XC 
XC    none
XC 
XC 
XC`009LOCALS
XC
X`009INTEGER CLI$GET_VALUE 
X`009EXTERNAL CLI$GET_VALUE 
XC`009system routine to get a value from a command line
XC
X`009INTEGER STATUS
XC`009status of command line extraction
XC`009 
XC`009BEGIN
X
X`009STATUS = CLI$GET_VALUE('RNO_FILE',IFILE,)
X`009STATUS = CLI$GET_VALUE('TEX_FILE',OFILE,)
X
X        TEX = 0
X
X`009RETURN
X`009END
$ GOSUB UNPACK_FILE
$ FILE_IS = "INIOPS.PAS"
$ CHECKSUM_IS = 608058111
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X{   `009INI FILE MODULE FOR RNO TO TEX CONVERSION           }
X{ `009RANDALL VENHOLA JULY 7, 1987                        }
X               
X[INHERIT('UTILITYOPS','BASICFILEOPS','ARGOPS',
X         'TREEANDLISTOPS','SCREENHANDLERS')]
X
XMODULE INIOPS;
X
X
X                           
X[GLOBAL] PROCEDURE readarglistfromini( var ini : text; var index : integer;
X`009                          var list : arglist );
Xconst
X  iniseparator = '$';
Xvar
X  s : pckstr;
X  done : boolean;
X  gotten : boolean;
X  arg : argument;
X  inserted : boolean;
X
X  function endofline : boolean;
X  begin
X    if eof(ini) then
X       endofline := true
X    else
X       begin
X         if eoln(ini) then
X            endofline := true
X         else
X           begin
X             if ini^ = blank then
X                endofline := true
X             else
X                endofline := false
X           end
X       end
X  end;
X                     
X  function atseparator : boolean;
X  begin
X    atseparator := (ini^ = iniseparator)
X  end;
X
X  procedure readpckstr( var s : pckstr; var gotten : boolean );
X  var
X    ch : char; 
X    done : boolean;
X    charindex : integer;
X  begin
X    s.body := blank;
X    done := false;
X    charindex := 0;
X    repeat
X        if endofline then
X            done := true
X        else
X          if atseparator then
X             done := true
X          else
X             if charindex = maxchars then
X             begin
X`009        warningmessage('readini','ini file argument size overflow');
X                done := true                                              
X             end
X`009     else
X             begin
X                read(ini, ch);
X                charindex := charindex + 1;
X                s.body[charindex] := ch
X             end;
X         s.length := charindex
X    until done;
X    gotten := charindex > 0;
X    if atseparator then read(ini, ch)                      
X  end;
X  
X  procedure readindex(var index : integer; var gotten : boolean );
X  const
X    ndigits = 3;
X  var
X    count : integer;
X    ch    : char;
X  begin
X    gotten := true;
X    count := 0;
X    index := 0;
X    repeat
X        if endofline then
X            gotten := false
X        else
X          if count < ndigits then
X          begin
X             read(ini, ch);                   
X             count := count + 1;
X             if ch in ['0'..'9'] then
X                index := index*10 + ord(ch) - ord('0')
X             else
X             begin
-+-+-+-+-+ End of part 3 +-+-+-+-+-

