TuxGetFloat Function

Action

Retrieves the value of a specified floating-point field within a typed buffer. This function can be used to manipulate any of the following predefined buffer types:

FML, FML32

Include file

TUXEDO.bdh

Syntax

TuxGetFloat(in hBuffer  : number,
            in nFieldId : number,
            in nIndex   : number optional): float;

Return value

Floating-point value retrieved from the typed buffer.

Parameter Description
hBuffer Typed buffer allocated with TuxGetBuffer or Tux_tpalloc.
nFieldId Identifier specifying a field of the typed buffer
nIndex Array index (optional). This parameter has to be passed to the function if the field identifier specifies an array.

Example

const
  ID_NUMBERS :=  8;
  ID_PRODUCT := 16; 

dcltrans
  transaction TMain
  var
    hBuffer, olen : number;
    fResult       : float;
  begin
    Tux_tpbegin(30, 0); 

    // allocate buffer
    TuxGetBuffer(hBuffer, "FML", NULL, 1024); 

    // store two floating-point values in buffer
    TuxSetFloat(hBuffer, ID_NUMBERS, 807.33, 1);
    TuxSetFloat(hBuffer, ID_NUMBERS, 23.09, 2); 

    // multiply floating-point values
    Tux_tpcall("MULTIPLY", hBuffer, 0, hBuffer, olen, TPNOFLAGS);
 
    // retrieve product
    fResult := TuxGetFloat(hBuffer, ID_PRODUCT);
    Tux_tpcommit(0);
  end TMain;

Sample scripts

bankappn.bdf