Why can the circumflex sign be used for control chars in Delphi and is it a good idea?
delphi, history, syntax
Solution
Yes this is a legacy from days of yore.
And no you should not get into the habit of using this feature. Remember that code is read more often than it is written. Always think of your readers who most likely won't know what that syntax means.
Problem
I just came across an answer on SO with a curious syntax: How do I include a newline character in a string in Delphi? `MyString := 'Hello,' + ^M + ^J + 'world!';` I've been using Delphi for several years now, but I didn't know you could use the circumflex sign for control characters. Is this just a left over from the early Delphi or Turbo Pascal days? Should it be used nowadays? PS: I'm not asking about advice on the line break characters, there is sLineBreak and other methods as discussed in the original question.