CValueSet:GetKeyAt


The GetKeyAt method returns the string key at a specified index in the CValueSet.

Syntax

strKey = CValueSet:GetKeyAt( nIndex )

bullet.gif    Where nIndex is an integer in the CValueSet, ranging from 1 to CValueSet:Count. If the index is invalid, nil is returned.

bullet.gif    Returns the strKey string key at the specified index.

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 the specified index:

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

n = 3

-- fetch the data at index 3

Printf("Key[%d]= %s",n, S:GetKeyAt(n))

-- result: Key[3]= key_3

Related Topics

CValueSet class, Get, GetAt, GetValueAt


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