The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,831 other followers

Delphi ^A syntax: Documented, implied, or undocumented? – Stack Overflow

Posted by jpluimers on 2019/12/12

The syntax is documented. In the Turbo Pasal 3 documentation, i.e. the Z80 era.

Source my answer to [WayBackDelphi ^A syntax: Documented, implied, or undocumented? – Stack Overflow (I have added some WayBack Internet Archive links below) as it is from the Turbo Pascal era where the caret was introduced to support control characters:

This is from long ago as an escape character to enable you to have consts for control characters in a more readable way.
const
  CtrlC = ^C;
begin
  Write(Ord(CtrlC));
end.

This defines a Char constant with value #3, then writes 3 in Borland Pascal 7, and I remember seeing it years before that too.

I just checked the Turbo Pascal 5.0 and Borland Pascal 7.0 languages guides, but could not find it, so it seems undocumented.

Edit: I do remember this was a Borland thing, and just [WayBack] checked: it is not part of the ISO Pascal standard (formerly this was ANSI Pascal Standard, thanks Sertac for noticing this).

It [WayBack] is documented in the Free Pascal documentation [WayBack].

SGI uses the backslash as escape character, as per their docs [WayBack].

More Edit: I found it [WayBackdocumented in Delphi in a Nutshell and the [WayBackDelphi Basics site.

Found it: Just found it on page 37 of the Turbo Pascal 3 Reference Manual [WayBack].

(Marco van de Voort found the Free Pascal documentation)

It in fact originates in the 1984 Turbo Pascal 1 edition, as per the [WayBack] Turbo_Pascal_Reference_Manual_Feb84.pdf:

–jeroen

One Response to “Delphi ^A syntax: Documented, implied, or undocumented? – Stack Overflow”

  1. I remember using this type of syntax heavily in Turbo Pascal 1 under CP/M for controlling the output on screen and to printers. It was the time when it was required to develop your own printer drivers for your software. And sometimes it was also required to have different screen drivers depending on the CP/M flavours you want to support with your software. Especially when you wanted to work with menus, windows and the sometimes already available text formatting features.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: