How to print quotes inside quotes, but in comostore 64 basic v.2.0

I am writing a text adventure of a little c64 hobby and I stopped at one specific moment. Namely, I do not know how to quote anything inside a quote.

How to do this inside the Commodore 64 basic v.2.0.?

+5
source share
1 answer

You must generate a string containing the quote character, other than as a literal. The obvious way is to use CHR$ , as in:

 ? "ONE ";CHR$(34);"QUOTED";CHR$(34);" WORD" 

One example at http://www.c64-wiki.com/index.php/CHR%24 is very similar to this.

If you need to make a lot of them, you can save it in a variable to make the code shorter (which can make it faster or slower - if that matters, measure it yourself)

 10 QU$ = CHR$(34) 20 ? "ONE ";QU$;"QUOTED";QU$;" WORD" 
+10
source

Source: https://habr.com/ru/post/1208546/


All Articles