Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2015-01

Letter for ctrl char

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

^X (where X can be (almost?) any letter results in a char (^A=^Z = control chars)
This also works for none a-z letters. The compiler generates chars.

The only exception is ^{ standalone this is a char. But ^{$ is not a char followed by $, but a ^ followed by directive.

Yet this is apparently the only case where this happens. ^(* is a char and a *, not a ^ and comment.

Is that documented somewhere (I could not even find the docs for ^A-Z). It is not in
http://www.freepascal.org/docs-html/ref/refse8.html#x20-190001.8 "character strings)
Also http://www.freepascal.org/docs-html/ref/ref.html has "constant strings" (under types) but of course this is a char not a string.

This compiles
   writeln( ^{ );
   writeln( ^^ );
   writeln( ^. );
even space
   writeln( ^  );
are ok
   writeln( ^{ $);
does not.

Seems than directives have a special priority.

Also other multi char tokens (* are split
   writeln( ^(* 8 );
project1.lpr(4,12) Error: Incompatible types: got "Char" expected "LongInt"

So this is: char * 8

Reply by email