|
Post by pandawdy on Jun 17, 2020 19:26:48 GMT -5
Sorry if this has already been answered elsewhere.
Does Liberty Basic have a way to create comment blocks so that each line of code doesn't need an apostrophe?
|
|
|
Post by Carl Gundel on Jun 17, 2020 21:15:02 GMT -5
Sorry if this has already been answered elsewhere. Does Liberty Basic have a way to create comment blocks so that each line of code doesn't need an apostrophe? No. How do you suggest that should look?
|
|
|
Post by tenochtitlanuk on Jun 18, 2020 3:26:33 GMT -5
Yes please, I'd love to have them.
Their absence is one of my disappointments in LB since I try to write self-documenting code with lots of comments! Probably miss from old days on Pascal... and my memory needs many jogs when I revisit old code.
See Rosetta code at rosettacode.org/wiki/Comments for what other languages do.
(* foo bar multiline text comments *) would probably be my choice.
|
|
|
Post by honkytonk on Jun 18, 2020 3:43:56 GMT -5
C use: // Python use: # Liberty use: ' Pascal is dead at: 19 August 1662 in Paris
|
|
|
Post by Rod on Jun 18, 2020 4:12:11 GMT -5
Don't really see the need but two '' instead of one ', comments all code till another '' pair is found?
''hello this is commented code till we reach''
oooh, ugly.
'' hello this is commented code till we reach '' hmmmm...
Think I prefer
'hello this is 'commented code 'formatted neatly 'that ends nicely
|
|
|
Post by tenochtitlanuk on Jun 18, 2020 4:42:46 GMT -5
HonkyTonk- As Pascal famously nearly said, 'I code therefore I am.' There's a comment there...
And his other name was Blaise- reminds me of the Liberty torch!!
Rod- Not keen on repeating single apostrophes- '' looks too like a single double apostrophe " and would lead to confusion reading and typing code in some fonts.- At any rate with my increasingly poor eyesight.
|
|
|
Post by Carl Gundel on Jun 18, 2020 6:45:24 GMT -5
HonkyTonk- As Pascal famously nearly said, 'I code therefore I am.' There's a comment there... And his other name was Blaise- reminds me of the Liberty torch!! Rod- Not keen on repeating single apostrophes- '' looks too like a single double apostrophe " and would lead to confusion reading and typing code in some fonts.- At any rate with my increasingly poor eyesight. I guess the reason I haven't done this with Liberty BASIC thus far is that it just doesn't look like BASIC to me. I'm not ruling it out but I don't find any particular solution satisfying. I'd be tempted to borrow the string literal syntax. "This is a comment because it is not preceded by a PRINT statement. It can span multiple lines. Stop this comment with another double quote. In the editor the whole comment would be colored as any other comment." Looks like BASIC, sort of.
|
|
|
Post by Carl Gundel on Jun 18, 2020 6:48:01 GMT -5
HonkyTonk- As Pascal famously nearly said, 'I code therefore I am.' There's a comment there... And his other name was Blaise- reminds me of the Liberty torch!! Rod- Not keen on repeating single apostrophes- '' looks too like a single double apostrophe " and would lead to confusion reading and typing code in some fonts.- At any rate with my increasingly poor eyesight. I guess the reason I haven't done this with Liberty BASIC thus far is that it just doesn't look like BASIC to me. I'm not ruling it out but I don't find any particular solution satisfying. I'd be tempted to borrow the string literal syntax. "This is a comment because it is not preceded by a PRINT statement. It can span multiple lines. Stop this comment with another double quote. In the editor the whole comment would be colored as any other comment." Looks like BASIC, sort of. Or, this: REM "This is a multiline REMark. It can span multiple lines. Stop this comment with another double quote. In the editor the whole comment would be colored as any other comment."
|
|
|
Post by metro on Jun 18, 2020 8:22:12 GMT -5
another traditional option, just a button click away
|
|
|
Post by Carl Gundel on Jun 18, 2020 8:31:47 GMT -5
another traditional option, just a button click away
Yeah, the alternative is just tools support. Cool suggestion.
|
|
|
Post by pandawdy on Jun 18, 2020 13:13:02 GMT -5
Sorry if this has already been answered elsewhere. Does Liberty Basic have a way to create comment blocks so that each line of code doesn't need an apostrophe? No. How do you suggest that should look? Another implementation of BASIC, that will go unnamed because I'm not trying to promote them here, uses something like this: */ starts the comment. and then /* ends the comment.
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Jun 18, 2020 15:16:08 GMT -5
What about something like two statements, like REM my comments,license , etcetera ENDREM
|
|
|
Post by Brandon Parker on Jul 12, 2020 15:22:07 GMT -5
The "REM...ENDREM" words as Cundo suggests seems like an easy solution. I would probably borrow from C/C++, but change it to be BASIC by replacing the forward-slash with the apostrophe (single-quote mark) (i.e. '*) and the end of the quote being reversed (i.e. '*)
'* This is the start of a comment block This is the middle This is the end of the comment block *'
{:0)
Brandon Parker
|
|
|
Post by meerkat on Jul 13, 2020 4:26:51 GMT -5
Or just to be consistent use the same as Run Basic /* to begin and */ to end
/******************************\ A multiple line comment.. \******************************/
Dan
|
|
|
Post by PaulDZ on Jul 24, 2020 19:48:08 GMT -5
Just to throw my $0.02 in, I used to use an editor (for another ancient language called GLPro) that had this as a button on the editor.
Highlight the lines you wanted to comment, hit the "Comment" button and all lines would now have the single quote added at the first position of the lines. Highlighting lines and hitting the "UnComment" button would remove the single quote. Using this method made it easy to comment out blocks of code temporarily. Another set of buttons I miss from that editor was "Indent ->", "<- Indent", "Remove Indents". Made reformatting the source much less painful.
|
|