How can I create a string in Ada containing newlines, whose definition also has those newlines?
I've tried with 0..2 backslashes at the end of the line, but none of that compiles:
usage_info : String := "\
This should be the first line
and both the definition and the output
should contain newlines.";
In PHP this would be:
<<<BLOCK
1
2
3
BLOCK;
In C++ this would be:
const std::string s = "\
1
2
3";
In C#, it would be:
const string s =
@"1
2
3";
From what I know, Ada , like Java, does not support multiline literal. The only thing I see is something like this:
usage_info : String := "This should be the first line" & CR & LF
& "and both the definition and the output" & CR & LF
& "should contain newlines.";
Of course, you need to with and use Ada.Characters.Latin_1 to make these constants visible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With