AttributeGetBoolean Function

Action

Retrieves a boolean value from a specified attribute of the user.

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.

Another useful scenario is to define project attributes in Silk Performer. Using AttributeGet(Bool, Double, Int, String), these values can be retrieved by the BDL script in order to parameterize the script via project attributes.

Include file

Kernel.bdh

Syntax

AttributeGetBoolean( in sName : string ): boolean;

Return value

Boolean value that is retrieved.

Parameter Description
sName Name of the attribute of which the value is retrieved. The name of the attribute is case sensitive.

Example

dcltrans
  transaction TMain
  var
    sUrl,sString, sBuffer : string;
  begin
    AttributeSetString("name", "Jim");
    AttributeSetInt("age", 23);
    AttributeSetBoolean("member", true);
    AttributeSetDouble("cash", 4503.60);
    AttributeSetBinary("code", "\h9EF30533", 4);

    AttributeGetString("name", sString);
    writeln(sString);
    writeln(AttributeGetInt("age"));

    if AttributeGetBoolean("member") then
      writeln("true");
    else
      writeln("false");
    end;

    writeln(AttributeGetDouble("cash"));
    AttributeGetBinary("code", sBuffer);
    WriteData(sBuffer, STRING_COMPLETE);
  end TMain;