PropertyObject.GetValVariant

Syntax

PropertyObject.GetValVariant( lookupString, options)

Return Value

Variant

Variant that contains the value of the property. If the property is an empty array, this method returns a variant that contains an array with the bounds set to indicate that it contains no elements, such as [0..-1] .

Purpose

Returns the value of the property the lookupString parameter specifies in a variant.

Remarks

You can use this method to obtain the value of an entire array at once. When you obtain an array property using this method, TestStand resizes and redefines the dimensions the destination array to match the array you obtain. Refer to the example in this topic for more information about how to use this method.

Parameters

lookupString As String

[In] Pass an empty string to denote the PropertyObject to which the method applies, or pass the name of a subproperty within the PropertyObject. You can also pass lookup strings to this parameter.

options As Long

[In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options.

Example

LabWindows/CVI:     VARIANT tmpVariant = CA_VariantEmpty();     double *numArray = NULL;     unsigned int numElements;     TS_PropertyGetValVariant(propObj, &errorInfo,                              "Locals.NumArray", 0, &tmpVariant);     CA_VariantGet1DArray(&tmpVariant, CAVT_DOUBLE, &numArray,                          &numElements);     CA_FreeMemory(numArray);         CA_VariantClear(&tmpVariant); Visual Basic (function call):     Dim numArray As Variant     numArray = propObj.GetValVariant("Locals.NumArray", 0) Visual Basic (inline):     Dim numArray As Variant     numArray = propObj.Locals.NumArray Visual C++:     #include "tsvcutil.h"     SAFEARRAY *psa;     ::SafeArrayCopy(propObj->GetValVariant("Locals.NumArray", 0).parray, &psa);     TSUTIL::SafeArray<double, VT_R8> safeArray;     safeArray.Set(psa); // takes ownership.     std::vector<double> doubleVector;     array.GetVector(doubleVector);

See Also

Lookup Strings

PropertyObject.GetValInteger64

PropertyObject.GetValUnsignedInteger64

PropertyObject.GetValVariantByOffset

PropertyObject.SetValVariant

PropertyOptions

Thread Safety of the PropertyObject API and TestStand Variables