AttributeSetDouble Function

Action

Assigns a floating-point value to a specified attribute of the user. The function automatically creates the attribute if it does not exist.

User attributes are useful when working with Silk Performer frameworks, in fact, when the user behavior is defined in two separate script. In that case, user attributes enable the exchange of data between scripts, for example, between a Silk Performer and a Java script.

Include file

Kernel.bdh

Syntax

AttributeSetDouble( in sName  : string,
                    in fValue : float ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sName Name of the attribute whose value is set. The function automatically creates the attribute if it does not exist.
fValue Floating-point value that is assigned to the specified attribute.

Example

dcltrans
  transaction TMain
  var
    sString, sBuffer : string;
  begin
    AttributeSetString("name", "Jim");
    AttributeSetInt("age", 23);
    AttributeSetDouble("cash", 4503.60);
    AttributeSetBinary("code", "\h9EF30533", 4);
    
    // do anything, for example, call an external function
    AttributeGetString("name", sString);
    writeln(sString);
    writeln(AttributeGetInt("age"));
    writeln(AttributeGetDouble("cash"));
    AttributeGetBinary("code", sBuffer);
    WriteData(sBuffer, STRING_COMPLETE);
  end TMain;