' Utility to convert given file from special FSCII encoding to ASCII encoding. DECLARE SUB getline (line$) DECLARE SUB initializeProgram () DIM SHARED byte AS STRING * 1 DIM SHARED endOfFile initializeProgram OPEN COMMAND$ + ".5th" FOR BINARY AS #1 OPEN COMMAND$ + ".src" FOR OUTPUT AS #2 ' Start reading lines from the file 1 getline line$ IF endOfFile = 1 THEN GOTO 2 PRINT #2, line$ GOTO 1 ' End of file reached 2 CLOSE #2 CLOSE #1 SYSTEM SUB getline (line$) line$ = "" ' Start reading bytes from the file 3 IF EOF(1) <> 0 THEN endOfFile = 1: GOTO 4 GET #1, , byte ' Convert non-printable characters to printable ones IF ASC(byte) <= 9 THEN byte = CHR$(48 + ASC(byte)) END IF IF ASC(byte) <= 15 THEN byte = CHR$(65 + ASC(byte) - 10) END IF IF ASC(byte) = 255 THEN byte = " " END IF IF ASC(byte) = 253 THEN byte = CHR$(9) END IF ' Check for end of line character IF byte = CHR$(254) THEN GOTO 4 line$ = line$ + byte GOTO 3 ' End of line reached 4 END SUB SUB initializeProgram endOfFile = 0 ' Check if the command-line argument is empty IF COMMAND$ = "" THEN END END SUB