Am 07.12.20 um 21:28 schrieb James Richters via fpc-pascal:
I was recently troubleshooting a program that got a range check error and had
quite a time figuring it out... it gave me the line number that generated the
error... but unfortunately that line had a whole pile variables in it... it
was trying to access an element of an array, with formulas to specify the
elements, so I didn't know which part of this was generating the range check
error. Two things could have helped me here, one would be to know which
variable went out of range, and the other thing would be to know what the range
was, and for that matter what value was trying to be assigned... it seems to me
that the range checking routine must know the range it's checking for and it
should also know what contents of the variable that triggered the error.. so
why not output the value detected, the allowable range, and the variable name
along with the error? It would greatly simplify tracking down bugs. Anyone
have any comment of if there is a possibility of adding this information to
range check errors?
James
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Separate your big one line into a lot of lines like
if (a > 255) and
(B = 'Whats on ') and
(C <0 ) and
......
Winni
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal