On Wed, Oct 29, 2008 at 09:58:10PM +0100, Vinzent Höfler wrote:
Tom Verhoeff wrote:
I am surprised that for ShortString, the range is not
also 1 = i = Length(s).
IIRC Turbo Pascal only allowed you to access s[0] when range checking
was off, and similarly for s[i] with i Length(s).
No.
Tom Verhoeff wrote:
On Wed, Oct 29, 2008 at 09:58:10PM +0100, Vinzent Höfler wrote:
Tom Verhoeff wrote:
I am surprised that for ShortString, the range is not
also 1 = i = Length(s).
IIRC Turbo Pascal only allowed you to access s[0] when range checking
was off, and similarly for s[i] with i
Tom Verhoeff wrote:
On Wed, Oct 29, 2008 at 09:58:10PM +0100, Vinzent Höfler wrote:
Tom Verhoeff wrote:
I am surprised that for ShortString, the range is not
also 1 = i = Length(s).
IIRC Turbo Pascal only allowed you to access s[0] when range checking
was off, and similarly for s[i] with i
Can someone confirm what range checking FreePascal does (if enabled)
when indexing a string. I imagine shortstrings and ansistrings are
handled differently, but cannot find this in the documentation.
It looks like the following:
String Type Range Checked for s[i]
---
Tom Verhoeff wrote:
I am surprised that for ShortString, the range is not
also 1 = i = Length(s).
IIRC Turbo Pascal only allowed you to access s[0] when range checking
was off, and similarly for s[i] with i Length(s).
No. See transcript:
-- 8 -- the program --
{$R+}
var
s1 : String;