[fpc-devel] Letter for ctrl char
Martin Frb
lazarus at mfriebe.de
Sun Jan 25 14:51:37 CET 2015
^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
More information about the fpc-devel
mailing list