ListKeys

Description:              Returns an array of all keys used within a dictionary.  It is anticipated that this function will be used primarily in the context of metadata (extended information attached to a variable).  ListKeys also allows you to discover what is in a dictionary.

Returns:                    Array

Usage:                       Script

Format:                      ListKeys( dictionary[, order, return value ]);

Parameters:             Dictionary     { Dictionary }  { required }  { no default }

                                      The name of the dictionary.

                                    Order      { Boolean }  { optional }  { default: 0 }

                                      If TRUE, then the return array is ordered by key creation.  If FALSE, the return array is ordered alphabetically by key. Defaults to 0.

                                    Return Value    { integer }  { optional }  { default: 1 }

                                      Controls what is returned according to the following table:  Defaults to 1.

Value

Returns

< = 0

Invalid

1

1D array (vector) containing the dictionary keys

2

1D array (vector) containing the dictionary values, ordered by key

3

2D array (table).   The first column will contain the dictionary keys and the second will contain the dictionary values.  Ordered by key.

>= 4

Invalid

Example:

(given a dictionary named X as shown)

dictionary_with_three_defs_2.gif    R = ListKeys( X );

    R == [“A”, “B”, “C”];        

 

 

 

 

 

 

 

See Also:

 DictionaryMetaData, DictionaryCopy, DictionaryRemove