Menu file converter v2 Converts DeskMen menu files to text Written by Ian Clark (c) 1994-96 Ian Clark This prog converts DeskMen menu files to plain text It's a bit messy but it'll do! $+" ("+ t$="" "DeskMen menu file to text converter." "By and (c) 1994-96 Ian Clark" "------------------------------------"' "Please enter the name of the file to convert." "If you just press then the default of" "'' will be used."' "File to convert =>"in$ in$="" in$="" '"Now enter the output file, default '.^.Converted'"' "Output as =>"out$ out$="" out$=".^.Converted" "XOS_File",17,in$ ,,,,len%;error% error% 0,"I can't read that file! Does it exist?" block% len% "OS_File",16,in$,block%,0 x%=0 (block%?x%) "UNEM" : V2 file stack% 256:stptr%=stack% '"Version 2 style file" Loadmenu(in$) #& menu%=0:old%=0:mptr%=mtable%:m%=0 hand%= (out$) #hand%,"| DeskMen Menu definition file" ?block%=3 "OS_Word",14,block% "Territory_ConvertDateAndTime",-1,block%,block%,256,"%24:%MI.%SE on %WE, %DY%ST %MO %CE%YR" #hand%,"| Created by 'Convert' v2 at "+ String(block%) #hand%,"|" mptr%+=2 St(mptr%): #hand%,"{"+t$ mptr%+=1 iptr%=itable% Readitem(0) : Proc to recursivly read each item #hand%,"}" #hand% "SetType "+out$+" FFF" "MENU" : ~V1.30 ish version '"Old style menu file" x%=4 len% block%?x%=block%?x% block%?x%=0 block%?x%=10 '"Saving file" "OS_File",10,out$,&FFF,,block%+4,block%+len% very old version '"Very old style menu file" x%=0 len% block%?x%=block%?x%>>>1 block%?x%=0 block%?x%=10 block%-=4 len%+=4 '"Saving file" "OS_File",10,out$,&FFF,,block%+4,block%+len% '"File saved as '";out$;"'" Loadmenu(path$) path$ points to but could change if I impliment multi menus, etc. ioffset%,poffset%,ipos%,ppos%,hand% "OS_File",17,path$ ptr%,,,,len% ptr%<>1 len%<=0 hand%= (path$) x%=0 block%?x%= #hand% x%=0 block%?x%= #hand% menu% len%-8 "OS_GBPB",4,hand%,menu%,len%-8 #hand% x%=0 len%-8 menu%?(x%)=menu%?(x%) "OS_CRC",0,menu%,menu%+len%-8,1 crc% crc%<>!block% '"That menu failed it's CRC check!" ipos%=!menu% ppos%=menu%!4 mlen%=menu%!8 ilen%=menu%!12 plen%=menu%!16 mtable% mlen% itable% ilen% ptable% plen% ptr%=menu%+20 x%=mtable% mtable%+mlen% !x%=!ptr% ptr%+=4 ptr%=menu%+ipos% x%=itable% itable%+ilen% !x%=!ptr% ptr%+=4 ptr%=menu%+ppos% x%=ptable% ptable%+plen% !x%=!ptr% ptr%+=4 ptr%) ?ptr%>25 tx$<255 tx$+= (?ptr%):ptr%+=1 String(ptr%) ?ptr%>31 tx$<255 tx$+= (?ptr%):ptr%+=1 Menutext(menu%) ptr%,found%,text$ ptr%=mtable% found%= ptr%-mtable%