TuxSetInt Function

Action

Sets the value of a specified integer 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

TuxSetInt(in hBuffer  : number,
          in nFieldId : number,
          in nValue   : number,
          in nIndex   : number optional): boolean;

Return value

  • true if successful

  • false otherwise

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

Example

const
  ID_NUMBERS :=  8;
  ID_SUM     := 16; 

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

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

    // store two values in buffer
    TuxSetInt(hBuffer, ID_NUMBERS, 8, 1);
    TuxSetInt(hBuffer, ID_NUMBERS, 4, 2); 

    // calculate the sum of both values
    Tux_tpcall("SUM", hBuffer, 0, hBuffer, olen, TPNOFLAGS); 

    // retrieve result
    nSum := TuxGetInt(hBuffer, ID_SUM);
    Tux_tpcommit(0);
  end TMain;

Sample scripts

bankappn.bdf