Very often, I see people ask for how to embed multi-line strings in a Delphi source file.
The short answer is: you can’t.
The long answer is: you can’t and if you want you have to hack your way around.
The answer should be: just like any of these languages that do support multiline strings:
- Python
- embed them with triple single quotes or triple double quotes: [WayBack] 3. An Informal Introduction to Python — Python 3.6.1 documentation – strings
- JavasScript
- as of ECMAScript 6, you can use backticks: [WayBack] Template literals – JavaScript | MDN
- Ruby
- Via the Here Documents syntax: [Archive.is] File: literals.rdoc [Ruby 2.2.0] – Here Documents
- C#
- By prepending the opening double quote of a string with @: [Archive.is] Code: Generating Multiline String Literals (Visual C#)
Many languages support this through a feature called HEREDOC.
Now in Delphi and other languages like Java are building ugly workarounds like for instance this one: [WayBack] RAD Studio Tip: Using resource scripts to organize project dependencies. – Chapman World.
–jeroen