-
Declaration:
- Procedure Val (const S : string;var V;var Code : word);
-
Description:
- Val converts the value represented in the string S to a numerical value, and stores this
value in the variable V, which can be of type Longint, Real and Byte. If the conversion isn’t
succesfull, then the parameter Code contains the index of the character in S which prevented
the conversion. The string S is allowed to contain spaces in the beginning.
The string S can contain a number in decimal, hexadecimal, binary or octal format, as
described in the language reference.
-
Errors:
- If the conversion doesn’t succeed, the value of Code indicates the position where the
conversion went wrong.
-
See also:
- Str (580)
Listing: refex/ex74.pp