CValueSet:List


The List method lists the contents of the CValueSet as (string key, value) pairs in a default CTextView window named "Value Set Contents". This method automatically loops over the CValueSet contents. To prevent confusion with the characters in the listed string key, only a tab (no comma, etc.) is inserted between the string key and value.

It is the responsibility of the calling script to interpret the returned values as integer, number, string, or boolean values.

Syntax

CValueSet:List( strListName )

CValueSet:List()

bullet.gif    Where strListName is a string listed above the CValueSet listing in the text window.

Example

The following example creates a CValueSet S and then lists its members:

S = new_valueset("number")

-- constructor, set to values of type "number"

S:Add( "key_1", 15.5 )

-- add a key and value at index 1

S:Add( "key_2", -7.23 )

-- add a key and value at index 2

S:Add( "key_3", 78.6 )

-- add a key and value at index 3

S:List("My output list")

-- list all set members

Below is the result of the previous script as lizte in the CTextView window:

My output list

key_1      15.5

key_2      -7.23

key_3      78.6

Related Topics

CValueSet Class, Add


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