SetDouble Function

Action

Copies a double value (8-byte floating-point value) into a data structure at a certain position. You must declare a BDL string before using this function.

Include file

Kernel.bdh

Syntax

SetDouble( inout sString :string,
             in    nPos    : number,
             in    fDouble : float ) : boolean;

Return value

  • true if successful

  • false otherwise

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

Example

dcltrans
  transaction TSetDouble
  const
    SIZE_STRUCT := 32;
  var
    myBDLstring : string(SIZE_STRUCT);
    bOk         : boolean;
  begin
    // Set an 8-byte floating point value at position 8
    // in the BDL string myBDLstring and thereby (through mapping) 
set
    // the element myDouble in Struct1
    bOk := SetDouble(myBDLstring, 8, 12345.99);
    if bOk then
      write("myDouble successfully set to 12345.99"); writeln;
    else
      write("error setting myDouble"); writeln;
    end;
  end TSetDouble;

Output

myDouble successfully set to 12345.99