|
Post by jarychk on Jul 9, 2024 18:20:41 GMT
A single space is needed between a line to be printed and the line continuation character , this character: _
The line continuation character should not be part of a string for purpose of code line continuation.
'line continuation and string to hold CR or two of CR
r$=chr$(13) r1$=chr$(13)+" " 'see that this variable will not need space between itself and underscore character r2$=chr$(13)+chr$(13)+" " 'see that this variable will not need space between itself and underscore character
notice "any title"+r1$_ +"ONE hello"+r1$_ +"TWO hello"+r2$_ +"THREE we skipped a line"
print "but something like this, will not work." print print "let w$=chr$(13)+'' _''" print " ''line one''+w$" print " ''line two''"
end
|
|
|
Post by jarychk on Jul 9, 2024 18:40:28 GMT
What I say is in the code's commenting.
'this code WILL NOT work 'and maybe we should not expect 'it to work.
'line continuation character will not 'work as such if included at the end 'in a string variable.
let r0$=chr$(13)+" _" notice "Whatever title"+r0$ +"just one line of text to see or read"
END
|
|
|
Post by plus on Jul 9, 2024 19:26:36 GMT
I recommend chr$(10) for continuing on the next line, lets call it the "next line" character usually called NL$ ie NL$ = chr$(10).
txt$ = "3 lines:"+ chr$(10) + "line 2"+ chr$(10) + "and the third." print txt$ chr$(13) works as well but is traditionally called CR$ and uses same ascii as Enter button.
The line continuation character "_" is for basic code in the Basic interpreter without quotes around it. It is used for breaking a long line code into readable chunks vertically, so scrolling horizontally is not needed to read the code but the interperter reads it all as one line.
Chr$(13) separates the title from the rest of the message in a notice, no chr$(13) just gives title "Notice" additional chr$(13) will also serve as line breaks in a NOTICE statement.
In files made with Print #fileNum, something... Chr$(13) + Chr$(10) are automatically inserted after each Print #fileNum, something unless the statement ends with ; or , you need do nothing more to separate lines just like PRINT statements.
b = b + ...
|
|
|
Post by jarychk on Jul 9, 2024 23:16:49 GMT
Big reason choosing chr$(13), or what could be exchanged for chr$(13), and then the continuation character is because NOTICE box acts like it has a width limit, and I want to clearly as possible, view the message being placed into the code for the NOTICE box. If I extend the line of code horizontally using the example previous to this post, the size of lines is too difficult to judge, and I need to scroll to see the long horizontal code line.
NOTICE box seems to let me put in each separate line of between about 55 and 61 characters; and if line is too long, wrapping will happen which mostly makes the message to the user with the NOTICE box, more difficult to read.
Here shows what I mean:
' checking width and wrap for NOTICE ' first box wraps wrong ' second box is right
NOTICE "OFF CLOUD, wrong wrap"+chr$(13) _ +"It's three a.m., there's too much noise. Don't you people ever wanna go to bed?"+chr$(10) _ +"'Cause you feel so good, Do you have to drive me out of my head?"
NOTICE "wrap ok, OFF CLOUD"+chr$(13) _ +"It's three a.m., there's too much noise"+chr$(10) _ +"Don't you people ever wanna go to bed?"+chr$(10) _ +"'Cause you feel so good"+chr$(10) _ +"Do you have to drive me out of my head?"
end
(credit for the lyrics goes to The Rolling Stones.) (Just I thought might be a nice example here.)
|
|
|
Post by plus on Jul 10, 2024 1:20:59 GMT
Yeah 2nd way gives you good control and look at how the lines will fall.
s$ = "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" notice "Just how wide am I anyway?"+chr$(13)+s$
53 chracters per line on my system.
b = b + ...
|
|