I could swear I saw an easier way to handle those nulls. Ah something like this:
...
120 GET#8, A$
130 A=ASC(A$ + CHR$(0)) :REM NULL PROTECTION PATTERN
140 IF ST <> 0 THEN 200
...
Here's where I found it, this time around. I think I've also seen it on the "C64 Programming" Facebook page.
https://www.lemon64.com/forum/viewtopic.php?p=181978&sid=5e9b35d1a6b8e77a89c45bb383be70cf#181978
Quote: |
30 print asc(t$): rem display the byte in ASCII code |
Make that
Code: |
30 print asc(t$+chr$(0)) |
so it won't barf when it encounters chr$(0) which get# returns as empty string.
=====================================================================================================
* Upside: terser code.
* Downside: string cat is probably slower.
* Downside: might encourage the garbage collector to run.
^ So, good for small files, bad for big files?