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ab@4TB@TP>F<K@4Ab@$VE@TP?P8K@E@@4*,!=IPUQR5TRNEDUEQVB@TP>F<K@
VWIb@
XH7B@T0=F<K@XDb@DP/4f@@Cb@DNc@0??__RNAUUTYTRLUTTCc@X_@@8@Aaj@Hm@dCe@PAaj@Tc@A
Vaf@E
Xb@mQ)1VYm86d4A"Y/U'd$9RTAc@4_VEMUTAc@<gR.AWf4YVZ,UFHm@BHm@"NmD5af@:?TUTAUUTE
V%af@
XYG@@NPaj@0A@Eaj@PAb@Daf@Tc@OUEUF%DSEEUaf@YG@@NPaj@0A@Eaj@PAb@Daf@Tc@.TUUE%UQ
VSEUa
Xf@/?Tf4AWf4YVZ,UFHm@BHm(CHQMc@0>4E&X,UVTCc@X/M6XCH"U6Y)9FHQIc@P?YU4TQEc@0;F%
VFd%!
XVY!QVY29VX-UFH:@RTCc@$fSOQTQA@mCDaj@e@Tak@Ec@Ac@PAc@SOfTTAc@4f@@8@Aaj@G@Tak@
VEb@P
Xaf@PAb@$UQSEUaf@>;4SQIc@P?YU4TQEc@0>SAESIQUTCc@,?TP1TRTE5af@fG@@NPaj@0A@Eag@
V4-Iz
$ CALL UNPACK [.UUCODE.PASCAL]EXES-OBJS.MFTU;1 1143154198
$ create 'f'
X.if help
X.rm 75`20
X.lm 1
X.no paging
X.no flags lowercase
X.flags accept
X.endif help
X.if doc
X.date
X.enable bar
X.flags accept
X.flags bold
X.no flags index
X.flags substitute
X.left margin 2
X.right margin 74
X.endif doc
X.if help
X.i-1;1 UUDECODE
X.break
XSee UUENCODE
X.break
X.i-1;1 UUENCODE`20
X.break
X.endif help
X.if doc
XUUCODE
X.break
X======
X.blank
X.endif doc
XTo use the UU_*_*CODE commands just put the following lines in your LOGIN.CO
VM:
X.blank`20
X.i+5;_$ set command acs_$public:uudecode.cld
X.i+5;_$ set command acs_$public:uuencode.cld
X.blank`20
XTo run this version of UU_*_*CODE you will need VAX-VMS V4.3 and upper.
X.break`20
X.if help
X.i-1;2 format
X.break`20
X.endif help
X.if doc
X.blank
XFormat
X.break
X======
X.blank
X.endif doc
X uude<code> </MODE=> </OUTPUT=> </LOG=> </TABLE=> "input filespec."
X.break`20
X uuen<code> </MODE=> </OUTOUT=> </LOG=> </TABLE=> </SPLIT=>
X.break`20
X.i+11;"input filespec." "output filespec."
X.blank`20
Xwhere:
X.literal
X`20
X       "filespec." means any Vax Filespecification
X                   Files with .UUE are default for uudecode-input-files
X                   and uuencode-output-files.
X                   Example: 1. uud dummy.dat (decodes the file DUMMY.DAT)
X                            2. uud dummy     (decodes the file DUMMY.UUE)
X`20
X       /MODE=      are  ATARI VAX VAXBIN
X`20
X                   ATARI  : de/encoding files destinated to Atari ST to
X                            put them via Kermit etc. on the Atari.
X                   VAX    : de/encoding any file that will have records
X                            in varying record format (f.e. Ascii-files)
X                   VAXBIN : de/encoding any file that will have records
X                            in fixed record format (f.e. Exe-Files)
X`20
X      /OUTPUT=     any VAX Filespecification that should be used instead
X                   of the file concerning the encoded file header.
X`20
X      /LOG=        any Vax Filespec.
X`20
X                   keep a log of errormessages in the specified file
X`20
X      /TABLE=      any Vax filespecifiacation.
X`20
X                   declares the table that should be used for
X                   decoding the file.
X`20
X      /SPLIT=I     splits the encodefile into I kByte partes so that
X                   UUDECODE will be able to put them together at
X                   decoding time. I has to an integer value.
X.end literal
X.if help
X.break`20
X.i-1;2 Author
X.break
X.endif help
X.if doc
XAuthor
X.break
X======
X.blank
X.endif doc
XPlease send any questions/suggestions/comments to:
X.blank
X.i+5;Christian Bode`20
X.blank
X.i+5;<KPH017@DJUKFA11.BITNET>
X.break
$ CALL UNPACK [.UUCODE.PASCAL]UUCODE.RNO;1 778839760
$ create 'f'
XDEFINE VERB UUDECODE
X IMAGE "WKU$ROOT:`5BEXE`5Duudecode.exe"
X PARAMETER P1, LABEL=INFILE, PROMPT="Input_file?", VALUE(REQUIRED)
X QUALIFIER MODE, VALUE(TYPE=MODES), DEFAULT
X QUALIFIER OUTPUT, VALUE(TYPE=$FILE)
X QUALIFIER LOG, VALUE(TYPE=$FILE)
X QUALIFIER TABLE, VALUE(TYPE=$FILE)
XDEFINE TYPE MODES
X KEYWORD ATARI
X KEYWORD VAX
X KEYWORD VAXBIN, DEFAULT
$ CALL UNPACK [.UUCODE.PASCAL]UUDECODE.CLD;1 1382096658
$ create 'f'
X`5BINHERIT('SYS$LIBRARY:STARLET')`5D
Xprogram uudecode_vms (INPUT,output,infile,tablein,OUTFILE,atariout,logout);
X`7B Original source pilfered from the MS-DOS turbo version on SIMTEL20`7D
X`7B Converted from Turbo to Vax-Pascal by Erik Olson, Harvey Mudd College
X                                         (EOLSON@HMCVAX.BITNET)
X                                         (eolson@muddcs.UUCP)
X     10/86 `7D
X`7BCorrected small bug for End of file -  10/15/86 eol`7D
X`7BChange of optical presentation by Christian Bode KPH017@DJUKFA11.BITNET`7
VD
X`7BNow handling Dumas splitting file format `7D
X`20
X`7B 3-27-91
X`09Eliminated the problem of hunk`5Bi`5D being larger than 8 bits.
X`09J. Snider SNIDER@WKUVX1`7D
X
X  CONST offset = 32;
X`20
X  TYPE string80 = varying`5B80`5D of char;
X       pack_128 = packed array`5B1..128`5D of char;
X       unsigned_word = `5Bword`5D 0..65535;
X`20
X  VAR outfile    : text;
X      infile     : text;
X      tablein    : text;
X      atariout   : file of pack_128;
X      logout     : text;
X      dummy      : packed array`5B1..512`5D of char;
X      dummy_count: integer;
X      lineNum    : integer;
X      line       : string80;
X      outidx     : integer;
X      outbuf     : pack_128;
X      lines      : integer;
X      display    : integer;
X      maindisp   : integer;
X      pasteboard : integer;
X      keyboard   : integer;
X      errors     : integer;
X      size       : integer;
X      op_mode    : packed array`5B1..10`5D of char;
X      log_mode   : packed array`5B1..10`5D of char;
X      flag1,flag2: boolean;
X      s_length   : integer;
X      table      : string80;
X      table_found: packed array`5B1..80`5D of char;
X      table_length : unsigned_word;
X      file_not_found : boolean;
X      header     : string80;
X`20
XFUNCTION SMG$CREATE_VIRTUAL_DISPLAY(
X    ROWS, COLUMNS : INTEGER;
X    VAR DISPLAY_ID : INTEGER;
X    DISPLAY_ATTRIBUTES, VIDEO_ATTRIBUTES, CHAR_SET : UNSIGNED
X        := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$CREATE_PASTEBOARD (
X    VAR PASTEBOARD_ID : INTEGER;
X    OUTPUT_DEVICE : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR:= %IMMED 0;
X    ROWS, COLUMNS : INTEGER := %IMMED 0;
X    PRESERVE_SCREEN_FLAG : BOOLEAN := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$CREATE_VIRTUAL_KEYBOARD (
X    VAR KEYBOARD_ID : INTEGER;
X    FILESPEC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR := %IMMED 0;
X    DEFAULT_FILESPEC : PACKED ARRAY `5BC..D:INTEGER`5D OF CHAR := %IMMED 0;
X    RESULTANT_FILESPEC : PACKED ARRAY `5BE..F:INTEGER`5D OF CHAR := %IMMED 0
X    ) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$PASTE_VIRTUAL_DISPLAY (
X    DISPLAY_ID, PASTEBOARD_ID : INTEGER;
X    ROW, COLUMN : INTEGER) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$UNPASTE_VIRTUAL_DISPLAY (
X    DISPLAY_ID,PASTEBOARD_ID : INTEGER) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$PUT_CHARS (
X    DISPLAY_ID : INTEGER;
X    TEXT : PACKED ARRAY `5BA..B:INTEGER`5D OF CHAR;
X    ROW : INTEGER := %IMMED 0;
X    COLUMN : INTEGER := %IMMED 0;
X    ERASE_FLAG, RENDITION_SET, RENDITION_COMPLEMENT : UNSIGNED := %IMMED 0;
X    CHAR_SET : UNSIGNED := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$READ_KEYSTROKE (
X    KEYBOARD_ID : INTEGER;
X    VAR TERMINATOR_CODE : UNSIGNED_WORD;
X    PROMPT : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR := %IMMED 0;
X    TIMEOUT, DISPLAY_ID : INTEGER := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION SMG$SET_CURSOR_ABS (
X    DISPLAY_ID : INTEGER;
X    ROW, COLUMN : INTEGER := %IMMED 0) : UNSIGNED; EXTERN;
X`20
XFUNCTION CLI$GET_VALUE (
X    ENTITY_DESC : PACKED ARRAY`5BA..B:INTEGER`5D OF CHAR;
X    VAR RETDESC : PACKED ARRAY`5BC..D:INTEGER`5D OF CHAR;
X    VAR RETLENGTH : UNSIGNED_WORD) : UNSIGNED; EXTERN;
X`20
X`20
XProcedure Writebin(ch : char);
Xbegin
X if op_mode='VAXBIN'
X  then
X   begin
X    dummy`5Bdummy_count`5D:=ch;
X    dummy_count:=succ(dummy_count);
X    if dummy_count = 513
X     then
X      begin
X       dummy_count:=1;
X       writeln(outfile,dummy);
X      end;
X   end
X  else
X   if op_mode = 'VAX'
X    then
X     if flag1
X      then begin flag1:=false; s_length:=256*ord(ch); end
X      else if flag2
X            then begin s_length:=s_length+ord(ch); flag2:=false end
X            else if (s_length<=outidx)
X                  then
X                   begin
X                    writeln(outfile);
X                    flag1:=false;
X                    flag2:=true;
X                    s_length:=ord(ch)*256;
X                    outidx:=0;
X                   end
X                  else
X                   begin
X                    write(outfile,ch);
X                    outidx:=outidx+1;
X                   end
X    else
X      if outidx=128
X       then
X        begin
X         write(atariout,outbuf);
X         outidx:=1;
X         outbuf`5Boutidx`5D:=ch;
X        end
X       else
X        begin
X         outidx:=outidx+1;
X         outbuf`5Boutidx`5D:=ch;
X        end;
Xend;
X`20
X  procedure Abort(message: string80);
X  var line : string80;
X      blank: packed array`5B1..48`5D of char;
X    begin `7Babort`7D
X      if message<>'Successful.' then errors:=succ(errors);
X      blank:=' ';
X      if lineNum > 0
X        then line:='Line '+dec(lineNum,5,1)+': '+message
X        else line:=message;
X      smg$put_chars(display_id:=display,row:=15,column:=13,text:=blank);
X      smg$put_chars(display_id:=display,row:=14,column:=13,text:=blank);
X      smg$put_chars(display_id:=display,row:=14,column:=53,
X                    text:=dec(errors,5,1));
X      smg$put_chars(display_id:=display,row:=15,column:=59-length(line),
X                    text:=line);
X      if (log_mode='YES') and (message <> 'Successful.')
X       then writeln(logout,line);
X    end; `7BAbort`7D
X`20
X  procedure NextLine(var s: string80);
X`20
X    begin `7BNextLine`7D
X      if LineNum mod 10 = 0
X       then
X        smg$put_chars(display_id:=display,row:=12,column:=53,
X          text:=dec(LineNum,5,1));
X      LineNum := succ(LineNum);
X      readln(infile, s)
X    end; `7BNextLine`7D
X`20
X   Procedure NextWord(var word:string80; var index: integer);
X    var finish : boolean;
X    begin `7Bnextword`7D
X     word := '';
X     while header`5Bindex`5D = ' ' do
X      begin
X       index := succ(index);
X       if index > length(header) then abort ('Incomplete header')
X      end;
X     finish:=false;
X     while not finish and ( index <= length(header))  do
X      begin
X       if header`5Bindex`5D = ' '
X         then finish := true
X         else
X           begin
X             word := word+header`5Bindex`5D;
X             index := succ(index);
X           end;
X      end
X    end; `7BNextWord`7D
X`20
X  procedure Init;
X  var outfilename : string80;
X      outfile_name: packed array`5B1..80`5D of char;
X      outf_length : unsigned_word;
X`20
X   procedure init_table;
X   var i : integer;
X   begin
X    table:='';
X    for i:=32 to 95 do table:=table+chr(i);
X   end;
X`20
X   procedure trailer;
X   BEGIN
X    smg$create_virtual_display (rows:=24,columns:=78,display_id:=maindisp);
X    SMG$CREATE_VIRTUAL_DISPLAY (ROWS:=16,COLUMNS:=60,display_id:=display,
X        DISPLAY_ATTRIBUTES:=SMG$M_BORDER);
X    SMG$CREATE_PASTEBOARD (PASTEBOARD_ID:=pasteboard);
X    SMG$CREATE_VIRTUAL_KEYBOARD(KEYBOARD_ID:=keyboard);
X    smg$paste_virtual_display(display_id:=maindisp,pasteboard_id:=pasteboard
V,
X                              row:=1,column:=1);
X    SMG$PASTE_VIRTUAL_DISPLAY(DISPLAY_ID:=DISPLAY,
X        PASTEBOARD_ID:=pasteboard,ROW:=4,COLUMN:=10);
X    smg$put_chars(display_id:=display,row:=2,column:=24,text:='UUDECODE V1.9
V');
X    smg$put_chars(display_id:=display,row:=3,column:=22,
X                  text:='by Christian Bode');
X    smg$put_chars(display_id:=display,row:=5,column:=2,text:='Decoding:');
X    smg$put_chars(display_id:=display,row:=7,column:=2,text:='as:');
X    smg$put_chars(display_id:=display,row:=9,column:=2,text:='Fileheadername
V:');
X    smg$put_chars(display_id:=display,row:=10,column:=2,text:='Mode:');
X    smg$put_chars(display_id:=display,row:=11,column:=2,text:='Filesize:');
X    smg$put_chars(display_id:=display,row:=12,column:=2,text:='Lines decoded
V:');
X    smg$put_chars(display_id:=display,row:=13,column:=2,text:='Lines short:'
V);
X    smg$put_chars(display_id:=display,row:=14,column:=2,text:='Errors:');
X    smg$put_chars(display_id:=display,row:=15,column:=2,text:='Last Error:')
V;
Xend;
X    procedure Getinput;
X`20
X      VAR inputname: packed array`5B1..80`5D of char;
X          infilename : string80;
X          inputl   : unsigned_word;
X          i,j      : integer;
X`20
X      begin `7BGetinput`7D
X       cli$get_value('INFILE',inputname,inputl);
X       infilename:='';
X       for i:=1 to inputl do infilename:=infilename+inputname`5Bi`5D;
X       i:=index(infilename,'`5D')+1;
X       j:=index(substr(infilename,i,length(infilename)-i+1),'.');
X       if j=0 then infilename:=infilename+'.UUE';
X       open(infile,infilename,history:=old,error:=continue);
X       smg$put_chars(display_id:=display,row:=5,column:=58-length(infilename
V),
X                     text:=infilename);
X       if status(infile)=3
X        then
X         begin
X          abort('File not found.');
X          file_not_found:=true;
X         end
X        else
X         begin
X          reset(infile);
X          if log_mode = 'YES'
X           then writeln(logout,'Input File     : ',infilename);
X         end;
X      end; `7BGetinput`7D
X`20
X    procedure GetOutFile;
X`20
X      var mode,table_name : string80;
X          ch: char;
X          ii : integer;
X`20
X      procedure ParseTable (mode : string80);
X      var i : integer;
X      begin
X       table:='';
X       if mode = 'file'
X        then NextLine(header)
X        else readln(tablein,header);
X       if not ((substr(header,1,5)+'     '  = 'begin') or
X               (substr(header,1,5)+'     '  = 'BEGIN') or eof(infile))
X        then
X         begin
X          while (substr(header,1,5)+'     ' <> 'begin') and
X                (substr(header,1,5)+'     ' <> 'BEGIN') and
X                (length(table)<64) do
X           begin
X            table:=table+header;
X            if mode = 'file'
X             then NextLine(header)
X             else readln(tablein,header,error:=continue);
X           end;
X           if table`5B1`5D = chr(96) then table`5B1`5D:=' ';
X           if table`5B63`5D = chr(126) then table`5B63`5D:=chr(94);
X           if length(table) < 64 then abort('Incomplete Decodingtable');
X         end
X        else abort('Incomplete Decodingtable');
X      end;
X`20
X      procedure ParseHeader;
X`20
X        VAR index: integer;
X`20
X        begin `7BParseHeader`7D
X          header := header+' ';
X          index := 7;
X          NextWord(mode, index);
X          NextWord(outfilename, index)
X        end; `7BParseHeader`7D
X`20
X      begin `7BGetOutFile`7D
X        cli$get_value('OUTPUT',outfile_name,outf_length);
X        outfilename:='';
X        if eof(infile)
X         then
X          abort('Nothing to decode.')
X         else
X          begin
X           NextLine (header);
X           while (substr(header+'     ',1,5) <> 'begin') and
X                 (substr(header+'     ',1,5) <> 'BEGIN') and
X                 (substr(header+'     ',1,5) <> 'TABLE') and
X                 (substr(header+'     ',1,5) <> 'table') and
X                 not eof(infile) do
X            NextLine(header);
X           if eof(infile)
X            then abort('Nothing to decode.')
X            else
X             if ((substr(header+'     ',1,5) = 'table') or
X                 (substr(header+'     ',1,5) = 'TABLE'))
X              then
X               begin
X                ParseTable('file');
X                while not ((substr(header+'     ',1,5) = 'begin') or
X                           (substr(header+'     ',1,5) = 'BEGIN') or
X                      eof(infile)) do
X                 NextLine(header);
X                if eof(infile)
X                 then abort('Nothing to decode')
X                 else
X                  begin
X                   ParseHeader;
X                   if log_mode = 'YES'
X                    then writeln(logout,'Fileheadername : ',outfilename);
X                   smg$put_chars(display_id:=display,row:=9,
X                                 column:=58-length(outfilename),
X                                 text:=outfilename);
X                  end
X               end
X              else
X               begin
X                ParseHeader;
X                if log_mode = 'YES'
X                 then writeln(logout,'Fileheadername : ',outfilename);
X                smg$put_chars(display_id:=display,row:=9,
X                              column:=58-length(outfilename),
X                              text:=outfilename);
X               end;
X          end;
X        cli$get_value('TABLE',table_found,table_length);
X        if table_length <> 0
X         then
X          begin
X           open(tablein,table_found,history:=old,error:=continue);
X           if status(tablein) = 3
X            then
X             begin
X              file_not_found:=true;
X              abort('tablefile not found');
X             end
X            else
X             begin
X              reset(tablein);
X              ParseTable('table');
X              table_name:='';
X              for ii:=1 to table_length do
X               table_name:=table_name+table_found`5Bii`5D;
X              if log_mode = 'YES'
X               then writeln(logout,'Tablefile      : ',table_name);
X              close(tablein);
X             end;
X          end;
X        if outf_length <> 0
X         then
X          begin
X           outfilename:='';
X           for ii:=1 to outf_length do
X            outfilename:=outfilename+outfile_name`5Bii`5D;
X          end;
X        if log_mode = 'YES'
X         then
X          begin
X           writeln(logout,'Outputfile     : ',outfilename);
X           writeln(logout);
X          end;
X        smg$put_chars(display_id:=display,row:=7,column:=58-length(outfilena
Vme),
X                      text:=outfilename);
X       end; `7BGetOutFile`7D
X`20
X      Procedure GetOpMode;
X      var present : unsigned;
X          op_length : unsigned_word;
X          opmode    : string80;
X          i         : integer;
X          log_length: unsigned_word;
X          log_file  : packed array`5B1..80`5D of char;
X      begin
X       cli$get_value('MODE',op_mode,op_length);
X       cli$get_value('LOG',log_file,log_length);
X       if log_length > 0 then log_mode:='YES' else log_mode:='NO';
X       if log_mode='YES'
X        then
X         begin
X          open(logout,log_file,history:=new);
X          rewrite(logout);
X         end;
X       opmode:='';
X       for i:=1 to op_length do opmode:=opmode+op_mode`5Bi`5D;
X       smg$put_chars(display_id:=display,row:=10,column:=58-length(opmode),
X                     text:=opmode);
X       if log_mode='YES' then writeln(logout,'Mode           : ',op_mode);
X       if op_mode='VAX'
X        then begin flag1:=true; flag2:=true; outidx:=0; end
X        else begin flag1:=false; flag2:=false; end;
X      end;
X`20
X      Procedure OpenOutFile;
X      begin
X       if op_mode='VAXBIN'
X        then
X         begin
X          open(outfile, outfilename,RECORD_LENGTH:=512,Record_type:=fixed,
X                        carriage_control:=none,history:=new);
X          rewrite(outfile);
X         end
X        else
X         if op_mode = 'VAX'
X          then
X           begin
X            open(outfile,outfilename,record_length:=65535,history:=new);
X            flag1:=true;
X            flag2:=true;
X            rewrite(outfile);
X           end
X          else
X           begin
X            open(atariout,outfilename,history:=new);
X            flag1:=false;
X            flag2:=false;
X            rewrite(atariout);
X           end;
X      end;
X`20
X    begin `7Binit`7D
X      lineNum := 0;
X      dummy_count:=1;
X      outidx:=0;
X      errors:=0;
X      file_not_found:=false;
X      trailer;
X      init_table;
X      GetOpMode;
X      Getinput;
X      if not file_not_found
X       then
X        begin
X         GetOutFile;
X         OpenOutFile;
X        end;
X    end; `7B init`7D
X`20
X  Function CheckLine: boolean;
X  var index : integer;
X      infilename : string80;
X    begin `7BCheckLine`7D
X      if line = ''
X       then
X        begin
X         abort ('Blank line in file');
X         while length(line) = 0 do NextLine(line);
X        end;
X      if length(line) > 7
X       then
X        if (substr(line,1,7) = 'include') or (substr(line,1,7) = 'INCLUDE')
X         then
X          begin
X           close(infile);
X           header:=line;
X           index:=9;
X           infilename:='';
X           nextword(infilename,index);
X           smg$put_chars(display_id:=display,
X                         row:=5,column:=58-length(infilename),
X                         text:=infilename);
X           open(infile,infilename,history:=old,error:=continue);
X           if status(infile) = 3
X            then
X             begin
X              abort('File not found.');
X              file_not_found:=true;
X             end
X            else
X             begin
X              reset(infile);
X              NextLine(line);
X              while (substr(line+'     ',1,5) <> 'BEGIN') and
X                    (substr(line+'     ',1,5) <> 'begin')     do
X               NextLine(line);
X              NextLine(line);
X              if log_mode='YES'
X               then writeln(logout,'Including      : ',infilename);
X             end;
X          end;
X      CheckLine := not((line`5B1`5D in `5B' ', '`60'`5D) or (line = 'end'))
X    end; `7BCheckLine`7D
X`20
X`20
X  procedure DecodeLine;
X`20
X    VAR lineIndex, byteNum, count, i, act_length : integer;
X        chars: array `5B0..3`5D of integer;
X        hunk: array `5B0..2`5D of  integer;
X`20
X    function nextch: char;
X`20
X      begin `7Bnextch`7D
X        lineIndex := succ(lineIndex);
X        if lineIndex > length(line)
X         then
X          begin
X           act_length:=length(line);
X           abort('Short Line.');
X           line:=pad(line,' ',lineindex);
X           lines:=lines+1;
X           smg$put_chars(display_id:=display,row:=13,column:=53,
X                         text:=dec(lines,5,1));
X          end;
X        if line`5Blineindex`5D = chr(96) then line`5Blineindex`5D:=' ';
X        if line`5Blineindex`5D = chr(126) then line`5Blineindex`5D:=chr(94);
X        if (index(table,line`5Blineindex`5D) = 0)
X          then abort('Illegal character in line: '+line`5BlineIndex`5D);
X        nextch:=line`5BlineIndex`5D;
X      end; `7Bnextch`7D
X`20
X    procedure DecodeByte;
X`20
X      procedure GetNextHunk;
X`20
X        VAR i: integer;
X`20
X        begin `7BGetNextHunk`7D
X          for i := 0 to 3 do BEGIN`20
Xchars`5Bi`5D := index(table,nextch) - 1;
XEND;
X          hunk`5B0`5D := (((chars`5B0`5D * 4) + (chars`5B1`5D div 16))MOD 25
V6);
X          hunk`5B1`5D := (((chars`5B1`5D * 16) + (chars`5B2`5D div 4))MOD 25
V6);
+-+-+-+-+-+-+-+-  END  OF PART 4 +-+-+-+-+-+-+-+-
