BuiltIn.EnumProperties Method

Applies to TestComplete 15.47, last modified on January 20, 2023
This method is obsolete. See the Remarks section below.

Description

The EnumProperties method returns the ObjPropertyIterator object which lets you work with a collection of the object’s properties. Use HasNext and Next methods of the ObjPropertyIterator object to iterate over the collection of the object’s properties.

Declaration

BuiltIn.EnumProperties(Param1, Param2)

Param1 [in]    Required    Object    
Param2 [in]    Optional    Boolean Default value: False   
Result An ObjPropertyIterator object

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

Param1

The object whose properties you want to retrieve. If this parameter has the null value (that is, Nothing in VBScript, null in JavaScript, JScript, C++Script and C#Script, None in Python and nil in DelphiScript), the EnumProperties will also return null.

Param2

Specifies whether to retrieve hidden properties of the object. Hidden properties are the ones which are displayed in the Object Browser but are not listed in the Code Completion window.

Result Value

An ObjPropertyIterator object which provides a scripting interface to the collection of the object’s properties.

Remarks

This method is obsolete. It is supported for backward compatibility only. To obtain information about the object’s properties, use the aqObject.GetProperties method.

Example

The following code example posts the list of the process’s properties and their values to the log.

JavaScript, JScript

p = Sys.Process("MyApplication");
props = BuiltIn.EnumProperties(p);

while (props.HasNext())
{
  prop = props.Next();
  Log.Message (prop.Name + ":\n" + prop.Value);
}

Python

p = Sys.Process("MyApplication")
props = BuiltIn.EnumProperties(p)
while props.HasNext():
  prop = props.Next()
  Log.Message (str(prop.Name) + ":\n" + str(prop.Value))

VBScript

Set p = Sys.Process("MyApplication")
Set props = BuiltIn.EnumProperties(p)

While props.HasNext()
  Set prop = props.Next()
  Log.Message prop.Name & ":" & VbCrLf & aqConvert.VarToStr(prop.Value)
Wend

DelphiScript

p := Sys.Process('MyApplication');
props := BuiltIn.EnumProperties (p);

while (props.HasNext()) do
begin
  prop := props.Next();
  Log.Message (prop.Name + ':' + #13#10 + aqConvert.VarToStr(prop.Value));
end;

C++Script, C#Script

p = Sys["Process"]("MyApplication");
props = BuiltIn["EnumProperties"](p);

while (props["HasNext"]())
{
  prop = props["Next"]();
  Log.Message (prop["Name"] + ":\n" + prop["Value"]);
}

See Also

GetProperties Method
GetMethods Method
GetFields Method
GetEvents Method
aqObjIterator Object
aqObjProperty Object

Highlight search results