CoreClasses Xojo Plugin

VariantCollection.Item Method (console safe)

Use this setter/getter function to get or set element by a string key.

Item(
   key as String) as Variant

Item(
   key as String
   assigns value as Variant)

Parameters

key
The string key for the element to get or set.
value (assignment parameter)
When using the setter then this is the variant to assign to the collection.

Returns

Variant
When using the getter then the requested variant is returned, or nil if it was not found.

Remarks

If the Collection is in multikey mode then only the first element with the specified key will be retrieved or set by this property.

A error code -2 will be when reading if there was no such key existed.
This error code can help you determine if the nil returned was a actually nil object or if the key did not exist.

See Also

VariantCollection Class