AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
getDictionaryNames (Pointer dict [, int sort]) yoix.util
 
The applicability of this function is broader than the name implies as it will work on any Pointer object even an Array, in which case it returns an array of strings representing the subscripts of the supplied array. In general, it returns an array containing the key or name fields contained in dict, which are sorted if sort is supplied and non-zero.
 
 Example:   The following script creates a dictionary and then prints it out in sorted order.
Dictionary example = new Dictionary {
    String name = "Firenze";
    String region = "Toscana";
    String province = "Firenze";
    int altitude = 50;
    int population = 778000;
    String citycode = "055";
};

Array k = yoix.util.getDictionaryNames(example, true);

int i;
for(i = 0; i<k@length; i++)
    yoix.stdio.printf("%-15s%O\n", k[i], example[k[i]]);
The results on standard output are:
altitude       50
citycode       055
name           Firenze
population     778000
province       Firenze
region         Toscana
 
 Return:   Array
 
 See Also:   Dictionary

 

Yoix is a registered trademark of AT&T Inc.