No, it is not from Turbo Pascal days. It is from decades before TP, and before MS-DOS, and probably even before UNIX. Something old like first 300 bit-per-second dialup modems and DEC VT-52 terminal, RT-8 OS on PDP-8 machine and early version of C. Or maybe even older - though everything older to me is mere legends :-).
"^" sign is shortcut for "Ctrl" key. So ^C
in traditional notation stands for Ctrl+C
in Microsoft notation. That notation was vastly used for textmode menus in MS-DOS times, like in the aforementioned Turbo Pascal, Norton Utilities, DOS Navigator, etc.
Out of my memory you can consider "^" for "subtract 64".
So as Chr(65)
is 'A'
then Chr(1)
would be ^A
.
And ^@
would be #0
:-) AFAIR in MS-DOS times pressing Ctrl+Shift+"2/@" would actually produce #0
into BIOS keyboard buffer :-)
^[ would AFAIR be #27
aka Esc(ape) char - and if you run telnet.exe
you would see it prompted as the escape character.
So Turbo Pascal long ago chosen to follow the time-blessed convention, and then rules of backward compatibility engaged ever since. Personally, i take 'bla-bla'^M^J'foo-baz'
literal more string-like than 'bla-bla'#13#10'foo-baz'
when you want it on one line. And constructing the value with plus is better fit when your literal takes several source lines.
The pity is that syntax highlighting in Delphi IDE is hopelessly broken on that kind of constants.