Function Reference


_VariantSet

Sets the value of a VARIANT structure from an AutoIt value.

_VariantSet($pVariant, $vValue [, $iSpecialType = 0])

Parameters

$pVariant Pointer to the VARIANT structure.
$vValue AutoIt value to set (e.g., Int32, String, Array).
$iSpecialType Optional: Override VARIANT type (default: 0, auto-detect).

Return Value

Success: Pointer to the VARIANT structure.
Failure: 0, with @error set to:
1 - Failed to allocate memory for new VARIANT.
2 - Failed to initialize VARIANT.

Remarks

If $pVariant is 0, a new VARIANT is allocated using __CoTaskMemAlloc.
Supports Int32, Int64, String, Double, Float, Bool, Ptr, Object, Array.

Related

_VariantRead, _SysAllocString, _SafeArrayFromAutoItArray