Adriaan van Os wrote:
Frank Heckenbach wrote:
Mirsad Todorovac wrote:
1. Does Borland Pascal do teh same, or is it a GPC bug?
Now I'm surprised. BP seems to always set x = 0 when ec <> 0, i.e. when invalid characters are found.
Can any BP user confirm whether that's the expected behaviour? (I've always used `Val' for entire number strings, so ec <> 0 would be an error in my programs, so I've never noticed this behaviour.)
If that's really so in BP, I suppose we should change it in GPC.
From the Turbo Pascal 6.0 Library Reference:
"Val( S: String; var V; var Code: Integer)"
"... If the string is somehow invalid, the index of the offending character is stored in Code;
The question is if V is (guaranteed to be) zero then. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707