I'm currently working with CGI/Perl when I have this idea. Here-Documents allow the coder to build multi-line strings without \n etc.
In Perl, there are 2 possibilities to build a string with line breaks:
Code: Select all
$string="Hello World!\n\nThis was an empty line\n4th line\n5th line...":
$string=<<TEXT;
Hello World!
This was an empty line
4th line
5th line...
TEXT
In PureBasic, this could be a possibility:
Code: Select all
Define string$="Hello World!"+#CRLF$+#CRLF$+"This was an empty line"+#CRLF$+"4th line"+#CRLF$+"5th line..."
Define string$=<<"Hello World!
This was an empty line
4th line
5th line..."
With Here-Documents in PureBasic you might build also MessageRequester() or TextGadget() in an easy way.
If this feature will be implemented, we can discuss together, how we will do it.
This could be a possibility:
Code: Select all
MessageRequester("Multiline Information", <<"This is a demonstration
of how to use here-
documents in PureBasic.
Thanks for reading.", #MB_ICONINFORMATION)
TextGadget(#PB_Any, <<"This is a complex example of multiline strings
that should contain variables.
My name is "+name$+<<" and
I'm "+Str(age)+<<" years old.")
As I said, there are many opportunities where this feature could be helpful. Currently I'm working with CGI/Perl and so on. So I need to work with HTTP-Requests too and this feature could help me in this special situation. But also to fill gadgets and requesters, as well as variables, this feature would be helpful.
I hope you understand what my intention is.