Page 1 of 1

Multiline Literal String

Posted: Fri Mar 04, 2016 3:08 pm
by eddy
Is it possible to extend literal string syntax to support multiline text ?

It's more readable than a very long line with escape characters.
The text will be simplier to write and update without multiple constant insertions (#CRLF$ #LF$ or #LF$)
Of course, in this case the IDE should not break the literal string internal indentation.
Like common string, There's no comment inside multiline literal string.

Code: Select all

If myText$ = ""
        myText$ = ~"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." ;end of literal string here ******
EndIf 
MessageRequester("Message", myText$)

Define hello.s= ~"\tHello\"Fred\", 
The semicolon [ ; ] has no special meaning inside this literal string or common string.
Regards\"John Doe\"" ;

MessageRequester("Message", hello)

Re: multiline literal string

Posted: Fri Mar 04, 2016 3:23 pm
by Julian
eddy wrote:It's more readable than a very long line with escape characters.
Why would you need to read it in the editor?

Does it change often?

If so, put it into a text file and include it into the compilation. All your text is then in a separate file nicely formatted. You can then easily implement multi-language nice and easy too.

Huge strings in source code makes me :(

;)

Re: multiline literal string

Posted: Fri Mar 04, 2016 3:43 pm
by eddy
Julian wrote:
eddy wrote:It's more readable than a very long line with escape characters.
Why would you need to read it in the editor?
If so, put it into a text file and include it into the compilation. All your text is then in a separate file nicely formatted. You can then easily implement multi-language nice and easy too.

Huge strings in source code makes me :(

;)
Of course, you can't handle multi-language application string resources with some simple string variables.

I said this could be handy for day-to-day programming.
  • JSON
  • XML
  • XMLDialog
  • HTML