10 REM ************ 20 REM UUDecoder 30 REM Bruce Murray 40 REM ************ 50 REM NC100/200 Version 60 REM Downloaded from Tim's Amstrad NC Users' Site 70 REM http://www.ncus.org.uk 80 REM Originally from the Amstrad Notepad Users' Web 90 CLS 100 INPUT "filename to uudecode....."fin$ 110 PRINT' 120 OSCLI("EXEC "+fin$) 130 REPEAT 140 INPUT LINE A$ 150 B%=INSTR(A$,"begin") 160 UNTIL B%=1 170 : 180 B%=B%+4:REM parse past "begin" 190 REPEAT B%=B%+1:ch$=MID$(A$,B%,1):UNTIL ch$<>" " 200 : 210 B%=B%+2:REM parse past 3 digit octal protection code 220 REPEAT B%=B%+1:ch$=MID$(A$,B%,1):UNTIL ch$<>" " 230 : 240 F%=B%:REM latch pointer to first char of filename 250 REPEAT B%=B%+1:ch$=MID$(A$,B%,1):UNTIL ch$="." 260 : 270 outfile$=MID$(A$,F%,B%+4-F%) 280 fout%=OPENOUT(outfile$) 290 : 300 REPEAT 310 INPUT LINE A$:IF INSTR(A$,"end")<>0 THEN UNTIL TRUE:PROCfinish:END 320 bytes%=(ASC(LEFT$(A$,1))-32) AND &3F:IF bytes%=0 THEN UNTIL FALSE 330 : 340 P%=1 350 : 360 REM four byte "loop" starts here 370 BIN%=0 380 FOR J%=1 TO 4 390 P%=P%+1 400 BIN%=64*BIN%+((ASC(MID$(A$,P%,1))-32)AND &3F) 410 NEXT J% 420 : 430 BPUT#fout%,(BIN% AND &FF0000)DIV&10000:bytes%=bytes%-1:IF bytes%=0 THEN GOTO 470 440 BPUT#fout%,(BIN% AND &00FF00)DIV&100:bytes%=bytes%-1:IF bytes%=0 THEN GOTO470 450 BPUT#fout%,BIN% AND &0000FF:bytes%=bytes%-1:IF bytes%=0 THEN GOTO 470 460 GOTO 370 470 REM four byte loop ends here 480 : 490 UNTIL FALSE 500 END 510 DEFPROCfinish 520 PRINT' 530 PRINT EXT#fout%;" bytes written to file ";outfile$ 540 CLOSE#fout% 550 ENDPROC