Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / New line in a string?

Author
Message
Kingius Returns
6
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 25th Oct 2013 09:32
Does anyone know how to put a new line into a string without using multiple print statements?

I have tried chr$(13) + chr$(10) but alas they are ignored by the print statement.
Kingius Returns
6
Years of Service
User Offline
Joined: 17th Oct 2013
Location: UK
Posted: 27th Oct 2013 14:16
I was able to modify a word wrap script that I found on the code library to check for Chr$(13) and drop the text on to a new line, so I have now solved the problem myself.
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Oct 2013 01:09
Annoyingly, you need both carriage return (13) and followed by a new line (10). I think this is a legacy from when computers where strange wonky contraptions with big iron gears and punch cards.


Formerly OBese87.
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Jan 2014 22:09 Edited at: 3rd Jan 2014 22:12
@Kingius Returns

Glad you solved it! Here's a note that's probably in line with you solution.

I don't believe Print will recognize special characters like codes 13 or 10. However, you can print a new line with an empty print statement and use your own character to indicate new line:



Enjoy your day.

Login to post a reply

Server time is: 2020-08-13 19:06:18
Your offset time is: 2020-08-13 19:06:18