index

Varkon MBS Programmers manual


inint - Function

Description

Reads a string from an open file or pipe and converts to an integer.

Syntax

  i:=inint(f, width);

  int  i;
  file f;
  int  width;

Principal parameters

f - The name of a filevariable associated with a file open for read or update (R or U)

Optional parameters

width - Number of characters to read. If not specified inint() reads characters as long as they are valid in the conversion to an integer value and stops reading on the first occurence of a character that is not valid.

Return value

The INT read.

Examples

  With the following line of data:

  "1 2345ABC"

  consecutive calls to inint() would read as follows.....

  i:=inint(f);    => i = 1

  i:=inint(f, 2); => i = 2

  i:=inint(f);    => i = 345

  i:=inint(f);    => i = Undefined, error code in iostat()

See also

ival() and iostat()


SourceForge.net Logo

Varkon 1.19D svn # 120M