From: ac387@yfn.ysu.edu (randall williams)
Newsgroups: comp.binaries.cbm
Subject: BASIC uudecode
Followup-To: comp.sys.cbm
Date: 31 Oct 1993 02:20:19 -0700
Organization: University of Arizona CS Department, Tucson AZ
NNTP-Posting-Host: caslon.cs.arizona.edu

Last changed - 10/31/93

This is a BASIC uudecode program. It would be good for uudecoding
files until something faster could be obtained. It ignores everything
until it finds the "begin" statement at the start of a uuencoded file.
The file must be a sequential
PETASCII file and converts it to a program file. Since it is in BASIC it is easy to change.

10 input"enter input file name";fi$
20 input"enter input device #";di
30 input"enter output file name";fo$
40 input"enter output device #";do
50 print"searching for file start"
60 open2,di,2,fi$+",s,r"
70 gosub400
80 ifleft$(w$,5)="begin"then190
90 print"file start not found"
100 printw$:goto70
190 print"beginning file conversion"
200 open3,do,3,"@0:"+fo$+",p,w":lc=1
210 gosub400:print"line ";lc;"  "
220 ifleft$(w$,3)="end"then360
230 x=2:ll=(asc(left$(w$,1))-32)and63
240 ifll=0then210
250 ll=ll/3*4
260 forz=0to3
270 ifx+z-1>llthenb(z)=32:goto290
280 b(z)=(asc(mid$(w$,x+z,1))-32)and63
290 next:x=x+4
300 c1=b(0)*4+int(b(1)/16)
310 c2=((b(1)*16)and240)+int(b(2)/4)
320 c3=((b(2)*64)and192)+b(3)
330 print#3,chr$(c1);chr$(c2);chr$(c3);
340 ifx-1=>llthenlc=lc+1:goto210
350 goto260
360 print"file conversion done"
370 print#3,"":close2:close3:end
400 w$=""
405 get#2,x$:ifx$=""thenx$=chr$(0)
410 ifx$=chr$(13)orx$=chr$(10)thenreturn
420 ifst<>0thenprint"error":goto370
430 w$=w$+x$
440 iflen(w$)=254thenreturn
450 goto405


-- 
Slay the dragons of your own mind before you call me insane.
ac387@yfn.ysu.edu
am789@cleveland.freenet.edu
-=*> Gandalf <*=-

