ParamCount Property

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Use the ParamCount property to obtain the total number of parameters of the event that the given aqObjEventObj object provides information about.

Declaration

aqObjEventObj.ParamCount

Read-Only Property Integer
aqObjEventObj An expression, variable or parameter that specifies a reference to an aqObjEvent object

Applies To

The property is applied to the following object:

Property Value

An integer value that specifies the total number of event parameters.

Example

The code below obtains the total number of the specified event's parameters and then posts the parameter names to the test log.

JavaScript, JScript

function EventParameters()
{

  // Specifies the object
  var Obj = Sys.Process("MyApplication");
    
  // Obtains the total number of the event's parameters
  var Num = aqObject.GetEvents(Obj).Item(0).ParamCount;
  
  // Posts the parameters names to the test log
  for (var i = 0; i < Num; i++)
    Log.Message("The parameter is: " + aqObject.GetEvents(Obj).Item(0).ParamName(i));
  
}

Python

def EventParameters():
  # Specifies the object 
  Obj = Sys.Process("MyApplication")
  # Obtains the total number of the event's parameters
  Num = aqObject.GetEvents(Obj).Item[0].ParamCount
  # Posts the parameters names to the test log
  for i in range(0, Num):
    Log.Message("The parameter is: " + aqObject.GetEvents(Obj).Item[0].ParamName[i])

VBScript

Sub EventParameters

  ' Specifies the object
  Set Obj = Sys.Process("MyApplication")
    
  ' Obtains the total number of the event's parameters
  Num = aqObject.GetEvents(Obj).Item(0).ParamCount
  
  ' Posts the parameters names to the test log
  For i = 0 to Num-1
    Log.Message "The parameter is: " & aqObject.GetEvents(Obj).Item(0).ParamName(i)
  Next
  
End Sub

DelphiScript

function EventParameters;
var Obj, Num, i;
begin

  // Specifies the object
  Obj := Sys.Process('MyApplication');
    
  // Obtains the total number of the event's parameters
  Num := aqObject.GetEvents(Obj).Item(0).ParamCount;
  
  // Posts the parameters names to the test log
  for i := 0 to Num-1 do
    Log.Message('The parameter is: ' + aqObject.GetEvents(Obj).Item(0).ParamName(i));
  
end;

C++Script, C#Script

function EventParameters()
{

  // Specifies the object
  var Obj = Sys["Process"]("MyApplication");
    
  // Obtains the total number of the event's parameters
  var Num = aqObject["GetEvents"](Obj)["Item"](0)["ParamCount"];
  
  // Posts the parameters names to the test log
  for (var i = 0; i < Num; i++)
    Log["Message"]( "The parameter is: " + aqObject["GetEvents"](Obj)["Item"](0)["ParamName"](i) );
  
}

See Also

Name Property
ParamName Property

Highlight search results