10
20
30
40
50
60
70
80
90 :
100 in%=0:out%=0:ONERROR:REPORT:PROCClose:PRINT:PROCend:END
110 max%=HIMEM-LOMEM-2000:DIMct%30,data%max%:X%=ct%:Y%=X%DIV256:A$=FNOS_GetEnv
120 name%=data%:IFA$="":INPUT"Mailfile: "A$:IFA$="":PROCend
130 I%=INSTR(A$+" "," "):to$=LEFT$(A$,I%-1):A$=MID$(A$,I%+1):IFA$="":INPUT"Append with: "A$:IFA$="":PROCend
140 I%=INSTR(A$+" "," "):at$=LEFT$(A$,I%-1):A$=MID$(A$,I%+1)
150 nm$=at$:FOR A%=1 TO LEN nm$:IFINSTR("./",MID$(nm$,A%,1)):nm$=LEFT$(nm$,A%-1)+CHR$(ASCMID$(nm$,A%,1)EOR1)+MID$(nm$,A%+1)
160 NEXT:IFFNfile(to$,5)<>1:PRINT"File '"to$"' not found":PROCend
170 len%=X%!10:IFFNfile(at$,5)<>1:PRINT"File '"at$"' not found":PROCend
180 IFlen%>max%:PRINT"File '"to$"' too long for this version":PROCend
190 OSCLI"Load "+to$+" "+STR$~data%:$(data%+len%)="begin 644 "+nm$:len%=len%+1+LEN$(data%+len%)
200 newlen%=len%+7+(X%!10)/45*62:IFnewlen%+data%>&F000:newlen%=&F000-data%
210 OSCLI"Save "+to$+" "+STR$~data%+"+"+STR$~newlen%+" FFFF0000 FFFFFF00"
220 in%=OPENIN(at$):out%=OPENUP(to$):PTR#out%=len%:REPEAT
230 PRINTCHR$13;100*PTR#in%DIVEXT#in%;"%";
240 num%=45:IFPTR#in%+num%>EXT#in%:num%=EXT#in%-PTR#in%
250 PROCgbpb(4,in%,data%,num%):data%!num%=0:data2%=data%+64
260 ptr1%=data%:ptr2%=data2%:PROCc(num%)
270 FOR z%=1 TO num%DIV3 - (num%MOD3<>0)
280 PROCc(?ptr1%DIV4):PROCc(16*(?ptr1%AND3)+ptr1%?1DIV16)
290 PROCc(4*(ptr1%?1AND15)+ptr1%?2DIV64):PROCc(ptr1%?2AND63)
300 ptr1%=ptr1%+3:NEXT:
310 $ptr2%="":ptr2%=ptr2%+1
320 PROCgbpb(2,out%,data2%,ptr2%-data2%)
330 UNTILPTR#in%>=EXT#in%:PROCCloseIn
340
350 $data2%="`"+CHR$13+"end"+CHR$13
360
370 PROCgbpb(2,out%,data2%,6):PROCClose
380 PROCend:END
390 :
400 DEFPROCc(A%):?ptr2%=32+A%-64*(A%=0):ptr2%=ptr2%+1:ENDPROC
410 :
420 DEFPROCClose:PROCCloseIn:IFout%:A%=out%:out%=0:CLOSE#A%
430 ENDPROC
440 :
450 DEFPROCCloseIn:IFin%:A%=in%:in%=0:CLOSE#A%
460 ENDPROC
470 :
480 DEFPROCend:END:
490 ENDPROC
500 :
510 DEFFNOS_GetEnv:A$=$&600:=MID$(A$,INSTR(A$+" "," "))
520 :
530 DEFFNfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%DIV256:=(USR&FFDD)AND&FF
540 :
550 DEFPROCgbpb(A%,ch%,ad%,nm%):?X%=ch%:X%!1=ad%:X%!5=nm%:CALL&FFD1:ENDPROC
560 :
570 DEFPROCtr(in%,out%,n%):LOCALl%:REPEAT:l%=max%:IFn%<l%:l%=n%
580 ?X%=in%:X%!1=data%:X%!5=l%:A%=4:CALL&FFD1:?X%=out%:X%!1=data%:X%!5=l%:A%=2:CALL&FFD1:n%=n%-l%:UNTILn%<1:ENDPROC
590
65449
162 CLGOSCLITRUE4{ATN