CValueSet:Get


The Get method returns the value assigned to a string key in the CValueSet. You can also get the value at a specific set index using the GetValueAt method.

Syntax

Value = CValueSet:Get( strKey )

bullet.gif    Where strKey is a string correscponding to the value stored in the CValueSet.

bullet.gif    Returns a Value is a number, integer, string, or boolean, according to the type of the CValueSet.

bullet.gif    On failure, nil is returned.

Example

The following example creates a CValueSet S and adds members to it, then returns the value at a key:

S = new_valueset("integer")

-- constructor for a set of type "integer"

S:Add( "key 1", 15 )

-- add a key and value

S:Add( "key 2", -7125 )

-- add a key and value

S:Add( "key 3", 9 )

-- add a key and value

Printf("Value= %d", S:Get("key_2"))

-- result: Value = -7125

Related Topics

CValueSet class, GetAt, GetKeyAt, GetValueAt

 


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.