Web Gadget SDK Web Gadget SDK
[Back to Web Gadget API Reference]
Web.Enum Class
Class used to define enumerations.
create Method
Creates and returns an enumeration object.
Syntax
Web.Enum.create(strEnum1, strEnum2, ...)
Parameters
Parameter Description
strEnumN A list of n string elements that define the enumeration.
Return Value
Enumeration object containing the specified string elements.
Example
The following example illustrate how to create and use a Enum object.
var enumColors = Web.Enum.create("red", "green", "blue);
for (var color in enumColors.getValues())
{
    // Do something with the color string    
    ...
}

getValues Method
Used to enumerate the values in an enumeration object.
Syntax
enum.getValues()
Parameters
None
Return Value
None
Example
See the example above for Wed.Enum.create for an example of how to use getValues() to enumerate the Web.Enum object.