gnu.de
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
thread

Val

Frank Heckenbach

15 Nov 2000 15 Nov '00
3:14 a.m.

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 -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html

0 0
Reply
Sign in to reply online Use email software

Back to the thread

Back to the list

HyperKitty Powered by HyperKitty version 1.3.12.