PROC dumpfile: global handle%,namewin% global fn$(128) global chonly% fn$="\dat\*.dbf" statuswin on setname "" namewin%=Gcreate(0,0,189,11,1) Gborder 0 Gcreate(0,12,189,68,1) Gborder 0 Guse 1 Gsetwin 4,20,183,59 screen 30,6,1,1 Gorder 1,1 chonly%=0 getfile:(0) showfile: ENDP PROC getfile:(op%) local o% o%=op% while 1 Dinit "File to dump?" Dfile fn$,"File:",0 if dialog Guse 1 Gcls if o% close: o%=0 setname "" endif if open%:(fn$)>=0 setname fn$ Guse namewin% Gcls Gat 5,9 Gprint fn$ Gborder 0 break endif elseif o% break else stop endif alert("No file open") endwh ENDP PROC open%:(name$) return ioopen(handle%,name$,$0600) ENDP PROC close: ioclose(handle%) ENDP PROC showfile: local loc&,len&,k%,nloc& global linelen% local pagelen%,blklen% Guse 1 while 1 linelen%=5+chonly%*15 pagelen%=linelen%*6 blklen%=linelen%*20 loc&=0 len&=0 ioseek(handle%,2,len&) while 1 linelen%=5+chonly%*15 pagelen%=linelen%*6 blklen%=linelen%*20 showdata:(loc&,len&) k%=get if k%=$122 REM menu Minit Mcard "File","Open",%O,"Jump",%J,"Exit",%X Mcard "Mode","Mixed",%M,"Character",%C k%=menu if k% k%=k% or $200 endif endif if k%>=$240 and k%<$280 REM Psion-letter k%=k% and $FFDF endif if k%=$200+%O getfile:(1) break elseif k%=$200+%J Dinit "Jump to" nloc&=loc& Dlong nloc&,"Offset:",0,len&-1 if dialog :loc&=nloc& :endif elseif k%=$200+%X return elseif k%=$200+%C chonly%=1 elseif k%=$200+%M chonly%=0 elseif k%=$100 REM up loc&=loc&-linelen% elseif k%=$101 REM down loc&=loc&+linelen% elseif k%=$102 REM right loc&=loc&+pagelen% elseif k%=$103 REM left loc&=loc&-pagelen% elseif k%=$104 REM Psion-up loc&=0 elseif k%=$105 REM Psion-down loc&=len& elseif k%=$106 REM Psion-left loc&=loc&-blklen% elseif k%=$107 REM Psion-right loc&=loc&+blklen% endif if loc&<0 loc&=0 elseif loc&>=len& loc&=len&-linelen%+1 endif loc&=(loc&/linelen%)*linelen% REM showdata:(loc&,len&) endwh endwh ENDP PROC showdata:(loc&,len&) local i%,n%,buf$(128),pos& cls i%=0 while i%<6 pos&=loc&+linelen%*i% i%=i%+1 ioseek(handle%,1,pos&) n%=ioread(handle%,addr(buf$)+1,128) if n%<0 n%=0 endif if n%>linelen% n%=linelen% endif pokeb addr(buf$),n% at 1,i% line:(pos&,n%,buf$) endwh ENDP PROC line:(pos&,n%,buf$) local i%,c$(1) print num$(pos&,-8), i%=0 while i%