index

Varkon MBS Programmers manual

# inflt - Function

## Description

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

## Syntax

      x:=inflt(f, width);

      float x;
      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 inflt() reads characters as long as they are valid in the conversion to a float value and stops reading on the first occurence of a character that is not valid.

## Return value

The FLOAT read.

## Examples

      With the following line of data:

      "1 2345.6 2E3 ABC"

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

      x:=inflt(f);    => x = 1.0

      x:=inflt(f, 2); => x = 2.0

      x:=inflt(f);    => X = 345.6

      x:=inflt(f);    => x = 2000.0

      x:=inflt(f);    => x = Undefined, error code in iostat()

## See also

fval() and iostat()

Varkon version 1.19C svn# 120