RunErr for w := StrToInt('1234567') is false, and RunErr for w := StrToInt('-1') is false when w is word. Is this correct behavior? Do I have to make much more checking then originally thought?
Code
var
s: string[10];
w: word;
b: boolean;
begin
s := '123';
w := StrToInt(s); // $007B
b := RunErr; // false (expected result)
s := '1234567';
w := StrToInt(s); // $D687 (conversion to long is $12D678)
b := RunErr; // false (unexpected result) <<<<<<<<<<
s := ' 1234';
w := StrToInt(s); // $0000
b := RunErr; // true (expected result)
s := '-1';
w := StrToInt(s); // $FFFF
b := RunErr; // false (unexpected result) <<<<<<<<<<
end;
s: string[10];
w: word;
b: boolean;
begin
s := '123';
w := StrToInt(s); // $007B
b := RunErr; // false (expected result)
s := '1234567';
w := StrToInt(s); // $D687 (conversion to long is $12D678)
b := RunErr; // false (unexpected result) <<<<<<<<<<
s := ' 1234';
w := StrToInt(s); // $0000
b := RunErr; // true (expected result)
s := '-1';
w := StrToInt(s); // $FFFF
b := RunErr; // false (unexpected result) <<<<<<<<<<
end;