GetFloat Function

Action

Retrieves a float value (4-byte floating-point value) from a specified data structure at a specified position. You must declare a BDL string before using this function.

Include file

Kernel.bdh

Syntax

GetFloat( in sString : string,
          in nPos    : number ): float;

Return value

float value

Parameter Description
sString BDL string corresponding to the data structure
nPos Starting position in the BDL string, where the first position is 1 (not 0)

Example

dcltrans
  transaction TGetFloat
  const    SIZE_STRUCT := 32;
  var
    myBDLstring : string(SIZE_STRUCT);
    fFloat : float;
  begin
    ...
    // Retrieve a 4-byte floating point value from position 16
    // in the BDL string myBDLstring and thereby (through mapping)
get
    // the element myFloat in Struct1
    fFloat := GetFloat(myBDLstring, 16);
    write("myFloat = "); write(fFloat); writeln;
  end TGetFloat;

Output

myFloat = 14.098000