[fpc-pascal] character escaping with ^LETTER
Dmitry Boyarintsev
skalogryz.lists at gmail.com
Mon Jan 19 14:29:20 CET 2015
hmm.. the character escaping is somewhat tricky.
The following code compiles:
writeln(^_^));
thanks,
Dmitry
On Mon, Jan 19, 2015 at 8:17 AM, Dmitry Boyarintsev <
skalogryz.lists at gmail.com> wrote:
> Hello,
>
> today I saw this kind of character escaping:
> var
> a :char;
> begin
> a:=^M; // char(13)
> writeln(^X); // char(24)
> end;
>
> The code of the character is derived as ord(letter)-ord('A')+1
> Not sure which pascal its inherited from... but Delphi 7 does compile it
> too.
>
> I vaguely remember it seeing before once .. and ... a lot of time ago.
>
> Should it be added to this page:
> http://www.freepascal.org/docs-html/ref/refse8.html#x20-190001.8 ? (need
> a bug report created?) or is it documented somewhere else?
>
> CodeTools syntax highlighter won't recognize the syntax as characters
> either (delphi 7 highlighter doesn't recognize it as a character escaping
> as well)
>
> thanks,
> Dmitry
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150119/2921add1/attachment.html>
More information about the fpc-pascal
mailing list