Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!udel!mmdf From: jones@eglin.af.mil (Calvin Jones, III) Newsgroups: comp.sys.amiga Subject: UUDECODE Message-ID: <9921@baldrick.udel.EDU> Date: 2 Feb 90 16:13:23 GMT Sender: mmdf@udel.EDU Lines: 71 "Robin D. Wilson/1000000" writes: > I have seen several references to the "uuencode/uudecode" programs, where do > I get them(it)? Is the one on the fish disks (Fish #38) the one I need, or > is there a new/better/more-featured/replacement somewhere else? > Is uudecode what I need to decode file that begin: > begin 644 program.zoo > M6D]/(#(N,#`@07)C:&EV92X:``# M_0(!C@@``'$````U%%-2G=NL"P``'0@```$```````````!&:6YD`'-E96LNA There's always the problem of getting the first few tools set up the shop. Here's the straight ASCII for a simple BASIC program I wrote so I could UUDECODE files on a clone. The code is pretty much straight BASIC and should run on just about any system (it sure was hard to go back to using line numbers). The program will attempt to open a file named "infile.uue" and will create the output file based on what id found in the "begin" line. It's not fancy, nor effecient, but it can get you started. ------8<----- Cut here. Ask Mommie for help if you can't use scissors. 10 OPEN "infile.uue" FOR INPUT AS #1 12 LINE INPUT#1, X$ 14 IF LEFT$(X$,6) <>"begin " THEN 12 16 N = INSTR(7,X$," ")+1 18 OF$ = MID$(X$,N) 20 OPEN OF$ FOR OUTPUT AS #2 25 PRINT "Opening file ";OF$;" for output..." 30 DIM X(255),C(255) 40 C1 = 256 50 C2 = C1 * C1 60 C3 = C2 * C1 100 LINE INPUT#1,X$ 110 L = LEN(X$) 111 IF L < 2 THEN 900 115 IF LEFT$(X$,1) = " " THEN 900 120 FOR I = 1 TO L 130 X = ASC(MID$(X$,I,1))-32 140 IF X = 64 THEN X = 0 150 X(I) = X 160 NEXT I 170 LL = X(1) 180 L2 = FIX((LL+2)/3)*4 190 C$ = "" 195 IF LL = 0 THEN 900 200 FOR I = 0 TO L2-4 STEP 4 210 T# = X(I+5)+64*(X(I+4)+64*(X(I+3)+64*X(I+2))) 220 T2# = FIX(T#/C2) 230 A$ = CHR$(T2#) 240 T# = T# - C2*T2# 250 T2# = FIX(T#/C1) 260 B$ = CHR$(T2#) 270 T# = T# - C1*T2# 280 C$ = C$ + A$ + B$ +CHR$(T#) 290 NEXT I 300 PRINT#2,C$; 310 LN = LN + 1 320 PRINT LN 400 GOTO 100 900 CLOSE 2 910 CLOSE 1 999 STOP ------8<----- Cut here. Ask Mommie for help if you can't use scissors. Hope this helps someone out there. --- Cal // Cal Jones - Internet: \X/ BBS: 904-243-6219 1200-9600HST 340Meg, all Amiga Single Tasking? *JUST SAY NO!!!*