[fpc-devel] Val() behaviour in a function depends on LongStrings ON/OFF?

Bart bartjunk64 at gmail.com
Thu Oct 15 23:19:47 CEST 2026


Well, simplified the example.
Calling Val() with an AnsiString parameter is handled different than
calling Val(0 with a ShortString param.
The behaviour with ShortString does proper range checking.
The behaviour with AnsiString depends on the state of RangeChecking.

Even if intended, this is inconsistent with the documentation.

Reported as https://gitlab.com/freepascal.org/fpc/source/-/work_items/41981

-- 
Bart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pas
Type: application/octet-stream
Size: 4587 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20261015/5383d384/attachment.obj>


More information about the fpc-devel mailing list