' ' Psave reverse 1.00 ' ' A GfA BAsic program written by S. Nijssen ' ' Translating done by Richard Karsmakers, June 5th 1987 ' CLEAR GOSUB intro CLS DIM byte%(7*18),groep%(7*18) ' IF FRE(0)<300000 THEN ALERT 3,"Not enough Memory...|Remove Ram-disk",1,"OK",antwoord SYSTEM ENDIF ' RESERVE 300000 opslag_start%=HIMEM+4000 label1: file_bekend=TRUE ' REPEAT CLS PRINT AT(21,3);"Which GfA Basic file should be treated ?" FILESELECT "\*.BAS",dummy$,file1$ IF EXIST(file1$)=0 THEN m$="File "+file1$+" cannot be found|on this disk, sorry.." ALERT 3,m$,1,"OK",antwoord file_bekend=FALSE ENDIF UNTIL file_bekend=TRUE ' OPEN "I",#1,file1$ lengte_file%=LOF(#1) CLOSE #1 ' IF lengte_file%<=7*18 THEN m$="File "+file1$+" is too short" ALERT 3,m$,1,"OK",antwoord GOTO label1 ENDIF ' BLOAD file1$,opslag_start% ' CLS PRINT AT(21,3);"Under which name should I save?" FILESELECT "\*.BAS",dummy$,file2$ CLS PRINT AT(21,3);"Be patient please. "; ' aantal_variabelen%=200 GOSUB lees_bytes ' totaal%=0 FOR byte%=3 TO 10 totaal%=totaal%+byte%(byte%) NEXT byte% IF totaal%<>592 THEN CLS m$="File "+file1$+" is no|GFA Basic file." ALERT 3,m$,1,"OK",antwoord GOTO label1 ENDIF ' GOSUB verander_bytes GOSUB schrijf_bytes IF DFREE(0)' :" PRINT PRINT " Find a common variable in those lines that causes the syntax error" PRINT " if the '==>' is removed before these lines. Replace this variable" PRINT " in the whole program by a totally different name with help of the" PRINT " 'replace' function. After this, continue at point 3." PRINT PRINT " ( Press the right mouse button to exit this program)" PRINT " ( Press the left mouse button to run again)" REPEAT MOUSE x,y,z UNTIL z<>0 REPEAT UNTIL MOUSEK<>0 IF z=2 THEN SYSTEM ENDIF GOTO label1 ' ' PROCEDURE lees_bytes FOR byte%=1 TO 7*18 byte%(byte%)=PEEK(opslag_start%+byte%-1) NEXT byte% groep%(1)=byte%(1) groep%(2)=byte%(2) byte%=11 FOR groep%=5 TO 33 waarde%=byte%(groep%*4-9)*16777216 waarde%=waarde%+byte%(groep%*4-8)*65536 waarde%=waarde%+byte%(groep%*4-7)*256 waarde%=waarde%+byte%(groep%*4-6) groep%(groep%)=waarde% byte%=byte%+4 NEXT groep% RETURN ' ' PROCEDURE schrijf_bytes byte%(1)=groep%(1) byte%(2)=groep%(2) byte%=11 FOR groep%=5 TO 33 waarde%=groep%(groep%) byte%(byte%)=waarde% DIV 16777216 waarde%=waarde% MOD 16777216 byte%(byte%+1)=waarde% DIV 65536 waarde%=waarde% MOD 65536 byte%(byte%+2)=waarde% DIV 256 waarde%=waarde% MOD 256 byte%(byte%+3)=waarde% byte%=byte%+4 NEXT groep% FOR byte%=1 TO 7*18 locatie%=opslag_start%+byte%-1 POKE locatie%,byte%(byte%) NEXT byte% RETURN ' ' PROCEDURE verander_bytes groep%(1)=0 groep%(2)=2 FOR groep%=5 TO 16 groep%(groep%)=0 NEXT groep% FOR groep%=17 TO 33 groep%(groep%)=groep%(groep%)+aantal_variabelen%*3 NEXT groep% RETURN ' ' PROCEDURE intro GRAPHMODE 3 DEFFILL 1,2,8 CLS x%=320 y%=200 b%=320 h%=200 REPEAT PBOX x%-b%,y%-h%,x%+b%,y%+h% b%=b%-5 h%=h%-3 SWAP b%,h% UNTIL b%<0 OR h%<0 GRAPHMODE 1 DEFFILL 0,1,8 REPEAT PBOX x%-b%,y%-h%,x%+b%,y%+h% ADD b%,8 ADD h%,6 SWAP b%,h% UNTIL b%>320 AND h%>200 PBOX x%-b%,y%-h%,x%+b%,y%+h% ' PRINT PRINT " PSave reverse " PRINT PRINT " With this program, it is possible to make files readable again" PRINT " after having been written to disk with 'Psave'." PRINT PRINT " ( Press the left mouse button to start the program)" PRINT " ( Press the right mouse button to exit)" REPEAT MOUSE x,y,z UNTIL z<>0 REPEAT UNTIL MOUSEK=0 IF z=2 THEN SYSTEM ENDIF RETURN