GetUserIdOnAgent Function

Action

Retrieves a unique ID (number) per current virtual user on an agent (machine). The ID is 1 for the first virtual user, 2 for the second and n for the nth virtual user. The number is unique per agent, but not across agents.

Include file

Kernel.bdh

Syntax

GetUserIdOnAgent(): number;

Return value

The unique identification number of the user.

Example

dcluser
  user
    TestUser
  transactions
    TGetUserIdOnAgent : 1;
dcltrans
  transaction 
    TGetUserIdOnAgent
  var
    nUserIdOnAgent: number;
  begin
    nUserIdOnAgent := GetUserIdOnAgent();
    write("user ID on agent = "); write(nUserIdOnAgent); writeln;
  end TGetUserIdOnAgent;

Output

user ID on agent = 1