Be careful exchanging files between PC and emulator!

One of the first problems I encountered in writing programs is just about the encoding and formatting of text that occurs between the PC and emulator. The SSB compiler, as well as the  SuperBasic itself, “digest” with difficulty the texts produced with PCs. It happens that the line terminators are misinterpreted, creating the usual MISTAKEs in compiling. Opening the texts with Emacs and save them is not enough. We must first create a file with Emacs, and then open them outside the emulator (in Windows) avoiding the use of tabulation and ending the file with a classic CR (carriage return or “new line”), otherwise we’ll run into unclear errors if you are using the SSB compiling. So if you really do not want to use Emacs for programming, the necessary steps are:

1- Launch Emacs – File – rename current file

2- Assign a file in this format: DOS1_folder_filename_extension (eg: DOS1_QL_TEST_bas)

3- File – save current file

4- Open in Windows the file with Notepad ++, or at least your favorite text editor being very careful to avoid the use of tabulation

5- go newline at the end of file

At this point you can proceed as usual!

2 thoughts on “Be careful exchanging files between PC and emulator!

  1. You actually don’t need to create the file on the QDOS end – If you use notepad++’s “Edit”->”EOL conversion”->”Unix/OSX format” you can create a file directly on the Windows side that has proper line endings.

  2. “New Line” (Hex 0A) and “Carriage Return” (Hex 0D) are two different characters. The QL and Linux use NL as a line ending. Windows usually uses a CR/NL combination, but most editors other than Notepad can usually be configured to use NL only.

    When copying text through the clipboard (using QPC_SYNCSCRAP) QPC2 translates the character encoding and line endings accordingly. For the DOS device I didn’t do it because that opens up a whole can of worms.

Comments are closed.