' WP Converter V1.2 ' ' A PD program to convert ASCII files to true WP format ' For use with "1st Word Plus" ' ' ' Explanation: In ASCII files, all spaces are represented by one code: $20 ' In WP Files, these are represented by $1E and $1C ($1E for ' each first space after a word) ' This program changes $20 to the appropriate WP codes ' After conversion, just switch on WP mode in "1st Word Plus"! ' ' Program can destroy ramdisks, etc. (!) ' RESERVE 50000 !Reserve 50 Kb for Basic b%=XBIOS(2) !Determine screen address c%=b%-&H50000-10 !Determine max file size FILESELECT "*.*","",lo$ !Get name of ASCII files IF EXIST(lo$)=0 !Is file present on disk? ALERT 1,"File not found!",1,"OK",a% EDIT !No, then end program ENDIF OPEN "I",#1,lo$ !Open file to get size size%=LOF(#1) !Get size CLOSE #1 !Close channel IF size%>c% !File larger than allowed? ALERT 1,"File too large!",1,"OK",a% EDIT !Then end program ENDIF BLOAD lo$,&H50000 !Load file on Hexadecimal $50000 x%=0 !Start on begin address+0 PRINT AT(1,1);size% REPEAT IF PEEK(&H50000+x%)=&H20 AND PEEK(&H50000+x%-1)=&H1E POKE (&H50000+x%),&H1C GOTO label2 ENDIF IF PEEK(&H50000+x%)=&H20 AND PEEK(&H50000+x%-1)=&H1C POKE (&H50000+x%),&H1C GOTO label2 ENDIF IF PEEK(&H50000+x%)=&H20 POKE (&H50000+x%),&H1E ENDIF label2: INC x% PRINT AT(1,2);x% UNTIL x%>size% !End of file reached? label: FILESELECT "*.DOC","",sa$ !Get name of WP file IF DFREE(0)