aqObject.EmptyVariant Property

Applies to TestComplete 15.68, last modified on October 03, 2024

Description

Returns an empty Variant value.

Declaration

aqObject.EmptyVariant

Read-Only Property Variant

Applies To

The property is applied to the following object:

Property Value

An empty Variant value.

Remarks

The result value coincides with the Empty constant in VBScript, the undefined constant in JavaScript, JScript, C++Script and C#Script, aqObject.EmptyVariant in Python and Unassigned in DelphiScript. Do not confuse an empty Variant value with a null Variant value. For more information on the Variant type, see the Variant Data Type article in the MSDN library.

Example

The code below checks whether the specified property has the empty value.

JavaScript, JScript

function EmptyVariant()
{

   // Specifies the needed object and the property name
   var Obj = Sys.Process("MyApplication");
   var sName = "PropertyName";
   
   // Obtains the property value
   var propValue = aqObject.GetPropertyValue(Obj, sName);
   
   // Checks whether the property value is empty
   if ( propValue == aqObject.EmptyVariant)
     Log.Message("The property value is empty.")
   else
     Log.Message("The property value is not empty.");
   
}

Python

def EmptyVariant():
  # Specifies the needed object and the property name  
  Obj = Sys.Process("MyApplication")
  sName = "PropertyName"
  # Obtains the property value 
  propValue = aqObject.GetPropertyValue(Obj, sName)
  # Checks whether the property value is empty 
  if propValue == aqObject.EmptyVariant:
    Log.Message("The property value is empty.")
  else:
    Log.Message("The property value is not empty.")

VBScript

Sub EmptyVariant

   ' Specifies the needed object and the property name
   Set Obj = Sys.Process("MyApplication")
   sName = "PropertyName"
   
   ' Obtains the property value
   propValue = aqObject.GetPropertyValue(Obj, sName)
   
   ' Checks whether the property value is empty
   If propValue = aqObject.EmptyVariant Then
     Log.Message "The property value is empty."
   Else
     Log.Message "The property value is not empty."
   End If
   
End Sub

DelphiScript

function EmptyVariant;
var Obj, sName, propValue;
begin

   // Specifies the needed object and the property name
   Obj := Sys.Process('MyApplication');
   sName := 'PropertyName';
   
   // Obtains the property value
   propValue := aqObject.GetPropertyValue(Obj, sName);
   
   // Checks whether the property value is empty
   if ( propValue = aqObject.EmptyVariant) then
     Log.Message('The property value is empty.')
   else
     Log.Message('The property value is not empty.');
   
end;

C++Script, C#Script

function EmptyVariant()
{

   // Specifies the needed object and the property name
   var Obj = Sys["Process"]("MyApplication");
   var sName = "PropertyName";
   
   // Obtains the property value
   var propValue = aqObject["GetPropertyValue"]( Obj, sName );
   
   // Checks whether the property value is empty
   if ( propValue == aqObject["EmptyVariant"] )
     Log["Message"]("The property value is empty.")
   else
     Log["Message"]("The property value is not empty.");
   
}

See Also

GetPropertyValue Method
SetPropertyValue Method

Highlight search results