Hi,
I'm facing a problem where I have a list of strings in DATAs to be printed in BASIC.
I would like to have a new line character in some of the strings to cope with the screen width, e.g. avoid string splitting in the middle of a word, and make printing of the strings nicer.
Similar to '\n' in C string literals. Is that possible?
Thanks for your support.
Hi,
To print the control characters CR and LF you can include them into a variable and print them with PRINT:
crlf$=CHR$(13)+CHR$(10)
Then you may want to detect in your DATAs the 2 characters "\n" and replace it, or any other character you want to assign the Carriage Return and Line Feed to, or perhaps do it based on the x coordinate of LOCATE.
I hope this helps you.
copy to text character 10 and 13
EDIT: Never mind. The other ideas are a lot simpler and better.
Quote from: McArti0 on 20:50, 01 April 24copy to text character 10 and 13
On second thought, this may be the easiest way.
Thanks guys, I ended up implementing the replacement of '\n' by chr$(10)+chr$(13)
https://gitlab.com/jferreira/cpc-basic-saga