Article View: comp.sys.atari.st
Article #33655GFA basic version of uudecode
From: John Logajan x3118
Date: Thu, 18 Aug 1988 15:17
Date: Thu, 18 Aug 1988 15:17
47 lines
1692 bytes
1692 bytes
This is a working but unfinished uudecode program in GFA Basic.
I used it successful on a total of one out of one attempts.
It does not (yet) handle line lengths other than "M" (45 undecoded chars.)
uuencode format:
The first character indicates the number of bytes encoded into the
current line. (M=45 typical)
Thereafter three 8-bit bytes are split into four 6-bit characters.
So you have to unpack groups of four characters into three bytes.
There are two end cases left to handle:
1.) Line lengths other than 45 but ending with a three byte group.
2.) Line lengths other that 45 ending with less than a three byte group.
Good luck.
Dim C(45),L(61)
Input "Name of file to decode";F$
Open "I",#1,F$
Repeat
Line Input #1,B$
Until Left$(B$,5)="begin"
O$=Mid$(B$,11,12)
Print O$
Open "O",#2,O$
While Left$(B$,3)<>"end"
Exit If Eof(#1)
Line Input #1,B$
For J=1 To 61
L(J-1)=(Asc(Mid$(B$,J,1))-32) And 63
Next J
K=1
For J=1 To 45 Step 3
C(J)=L(K)*4+Int(L(K+1)/16)
C(J+1)=(L(K+1)*16+Int(L(K+2)/4)) And 255
C(J+2)=(L(K+2)*64+L(K+3)) And 255
K=K+4
Print #2,Chr$(C(J));Chr$(C(J+1));Chr$(C(J+2));
Next J
Wend
End
--
- John M. Logajan @ Network Systems; 7600 Boone Ave; Brooklyn Park, MN 55428 -
- {...rutgers!dayton, ...amdahl!ems, ...uunet!rosevax!mmm} !viper!ns!logajan -
Technical Details
Message-ID:
<759@ns.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uwmcsd1!nic.MR.NET!umn-cs!ns!logajanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!uwmcsd1!nic.MR.NET!umn-cs!ns!logajan From: logajan@ns.UUCP (John Logajan x3118) Newsgroups: comp.sys.atari.st Subject: GFA basic version of uudecode Message-ID: <759@ns.UUCP> Date: 18 Aug 88 15:17:28 GMT Organization: Network Systems Corp. Mpls MN Lines: 46