Returns the complement of a set.
NewSet = SetComplement (Set)
Variable | Description |
---|---|
NewSet | The complement of a set. SET. |
Set | The set to be complemented. SET. |
SetComplement compares the members of the specified set to all possible members for that set, as defined by the type...is set declaration, and returns all members which are not included in the specified set.
[-] type COLORS is set [ ] Red [ ] Blue [ ] Yellow [ ] Green [ ] Purple [ ] Orange [ ] [-] COLORS HotColors = {...} [ ] Red [ ] Yellow [ ] Orange [ ] [ ] COLORS CoolColors = SetComplement (HotColors) [ ] [ ] //output of Print(CoolColors) is [ ] [ ] //{Blue, Green, Purple}