AttributeGetInt Function

Action

Retrieves an integer 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

AttributeGetInt( in sName: string ): number;

Return value

Integer 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
    i                      : number;
    sUrl, 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
    for i := 1 to AttributeGetInt("TIMES") do
      AttributeGetString("URL", sUrl );
      WebPageUrl(sUrl);
    end;

    AttributeGetString("name", sString);
    writeln(sString);
    writeln(AttributeGetInt("age"));
    writeln(AttributeGetDouble("cash"));
    AttributeGetBinary("code", sBuffer);
    WriteData(sBuffer, STRING_COMPLETE);
  end TMain;