The GPC reference claims that the 3rd parameter of Val is optional:
: procedure Val (const Source: String; var x: INTEGER OR REAL); : or : procedure Val (const Source: String; var x: INTEGER OR REAL; : var ErrorCode: Integer);
However, that's not the case in GPC (neither in BP from which the Val procedure comes). Thanks to Nicola Girardi for pointing out this discrepancy.
Though there are cases where one might want to ignore the 3rd parameter (such as if it was checked before calling Val that the string consists only of digits, or at least has a starting digit and one is willing to ignore trailing "garbage"), but IMHO they're rare enough that they don't justify another syntax extension.
So I suggest to "fix" the documentation by removing the first part. -- Of course, I could've just done that, but perhaps someone disagrees...
Also, maybe someone interested in writing/maintaining documentation might want to take this as a start (and perhaps write some words about Val in the reference while they're at it :-)...
Minor note: The name of the parameter should by `ErrorPosition' rather than `ErrorCode' (the BP documentation also calls it `Code', but we shouldn't copy their mistakes, it's not a code, just a position)...
Frank