Russell Whitaker wrote:
This used to work:
... before GPC did range checking. ;-)
program fil; var i : integer; s : string( 500 ); begin for i := 1 to 500 do s[ i ] := ' '; writeln("ok"); end.
Now I get "Value out of range"
The length of the string is uninitalized (and probably happens to be 0), so accesss to characters > 0 (i.e., all ;-) is out-of range.
You could do `SetLength (s, 500)' before the loop, or `uses GPC; [...] s := StringOfChar (' ', 500);' instead of the loop.
Frank