Attach/s 1.12 PAGE  MCODEd *attach command # Attaches a file to a message, (( and converts the message to binary 2, 28-Sep-1997 v1.00 JGH: Initial version <- .... Use UUcode, binary causes problems F@ 31-Jul-1998 v1.11 JGH: Initial save truncated if long file P) 25-Nov-2005 v1.12 JGH: /ext -> .ext Z: d%in%=0:out%=0:::Close::end: nAmax%=--2000:ct%30,data%max%:X%=ct%:Y%=X%256:A$=OS_GetEnv x2name%=data%:A$="":"Mailfile: "A$:A$="":end TI%=A$+" "," "):to$=A$,I%-1):A$=A$,I%+1):A$="":"Append with: "A$:A$="":end .I%=A$+" "," "):at$=A$,I%-1):A$=A$,I%+1) Xnm$=at$: A%=1 nm$:"./",nm$,A%,1)):nm$=nm$,A%-1)+(nm$,A%,1)1)+nm$,A%+1) 5:file(to$,5)<>1:"File '"to$"' not found":end >len%=X%!10:file(at$,5)<>1:"File '"at$"' not found":end =len%>max%:"File '"to$"' too long for this version":end V"Load "+to$+" "+~data%:$(data%+len%)="begin 644 "+nm$:len%=len%+1+$(data%+len%) Inewlen%=len%+7+(X%!10)/45*62:newlen%+data%>&F000:newlen%=&F000-data% ?"Save "+to$+" "+~data%+"+"+~newlen%+" FFFF0000 FFFFFF00" (in%=(at$):out%=(to$):#out%=len%: 13;100*#in%#in%;"%"; .num%=45:#in%+num%>#in%:num%=#in%-#in% 8gbpb(4,in%,data%,num%):data%!num%=0:data2%=data%+64 %ptr1%=data%:ptr2%=data2%:c(num%) ! z%=1 num%3 - (num%3<>0) -c(?ptr1%4):c(16*(?ptr1%3)+ptr1%?116) "0c(4*(ptr1%?115)+ptr1%?264):c(ptr1%?263) ,.ptr1%=ptr1%+3:: $ptr2%="a":ptr2%=ptr2%+2 6$ptr2%="":ptr2%=ptr2%+1 @%gbpb(2,out%,data2%,ptr2%-data2%) J#in%>=#in%:CloseIn T& $data2%="`a"+CHR$13+"end"+CHR$13 ^$data2%="`"+13+"end"+13 h) PROCgbpb(2,out%,data2%,7):PROCClose r!gbpb(2,out%,data2%,6):Close | end: : 2c(A%):?ptr2%=32+A%-64*(A%=0):ptr2%=ptr2%+1: : .Close:CloseIn:out%:A%=out%:out%=0:#A%  : $CloseIn:in%:A%=in%:in%=0:#A%  : "end:: PAGE=Q%:Q%?1=255:END  : +ݤOS_GetEnv:A$=$&600:=A$,A$+" "," ")) : Bݤfile(A$,A%):$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF : &=gbpb(A%,ch%,ad%,nm%):?X%=ch%:X%!1=ad%:X%!5=nm%:&FFD1: 0: :0tr(in%,out%,n%):l%::l%=max%:n%