SET Data Type

Description

The generic name for any data type that is declared with the type...is set declaration. For example, if you declare a COLORS data type with a type COLORS is set declaration, you can declare variables of type COLORS. A SET variable can hold one or more of the values declared for its data type. It cannot hold duplicate values. In addition to its defined values, a SET element can be another SET variable, as shown below.

Example

In the example, the COLORS set is defined and then two set instances are declared and initialized. The initialization uses the list constructor operator ({}) to specify the members of the sets. When you use braces in a declaration of a set object, 4Test implicitly casts the generated list as a set (in this example, a COLORS set). You cannot modify an existing set using braces—you can only initialize a new set.

[-] type COLORS is set
	[ ] red 
	[ ] yellow 
	[ ] navy 
	[ ] wedgewood
	[ ] royal
	[ ] green
	[ ] purple 
	[ ] orange
[ ] 
[ ] COLORS Blue = {navy, wedgewood, royal}
[ ] COLORS CoolColors = {purple, green, Blue}