CValueSet:ToTable
The ToTable method returns the CValueSet as a lua table of (string key, value) pairs.
table = CValueSet:ToTable()
table is a lua table of (string,value) pairs.
On failure, nil is returned.
The following example creates a CValueSet S and then returns it as a lua table:
|
-- constructor, set to values of type "number" |
|
-- add a key and value at index 1 |
|
-- add a key and value at index 2 |
|
-- add a key and value at index 3 |
|
-- return the set as a table of (string, value) pairs |
|
-- use the global list function to list the table |
Below is the lua table created in the previous script as listed in a CTextView window.
{
[1]=
{
[1]=key_1
[2]=158.25
}
[2]=
{
[1]=key_2
[2]=-7.23
}
[3]=
{
[1]=key_3
[2]=78.6
}
}
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.