Паскаль Val
Добавлено: 14 ноя 2006, 22:23
Напишите пожалуйста о функции val
Ее параметры
Язык Паскаль
Ее параметры
Язык Паскаль
Код: Выделить всё
Val (procedure)
---------------------
Converts a string value to its numeric representation.
Declaration:
procedure Val(S; var V; var Code: Integer);
where:
S string-type variable; must be a sequence of characters that
form a signed whole number
V integer-type or real-type variable
Code variable of type Integer.
Target:
Windows, Real, Protected
Remarks:
Converts the string value (S) to its numeric representation, as if it were
read from a text file with Read.
See Also:
Str
Код: Выделить всё
{Val.PAS}
{Sample code for the Val procedure.}
{ For Windows: }
{ uses WinCrt; }
var I, Code: Integer;
begin
{ Get text from command line }
Val(ParamStr(1), I, Code);
{ Error during conversion to integer? }
if code <> 0 then
Writeln('Error at position: ', Code)
else
Writeln('Value = ', I);
Readln;
end.