Microsoft SDK for Java

Value.assignVariant

Assigns a value to a variant.

Syntax

public static void assignVariant( Variant v, Object value )

Parameters

v

The variant to assign a value to.

value

The value to assign to the variant.

Remarks

The following actions can occur:

If value is a variant, that variant is copied into v.

If value is a primitive wrapper object, a String, or a Time object, the appropriate type code and value are stored in the variant.

If value is an object of any other type, a Variant.VariantDispatch value is stored in the variant.

If value is null, the type code of the variant is set to Variant.VariantNull.

Variant objects should be treated as fixed entities. Once a variant is created, changing the value stored in the variant is not recommended. Whenever possible, avoid using the assignVariant method. Call the toVariant method instead.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.