Skip to main content

Take-the-Intersection-Set

Command Description

Get the intersection of sets, and return as a new set

Command Prototype

objSetRet = Set.Intersection(ObjSet,ObjSet1)

Parameter Description

ParameterRequiredTypeDefaultDescription
ObjSetTrueexpressionObjSetThe set object to operate on
ObjSet1TrueexpressionObjSet1The sets to compare for intersections

return

objSetRet,The variable used to save the output of the command.

Demo

Dim ObjSet 
Dim ObjSet1
Dim objSetRet
ObjSet = Set.Create()
Set.Add(ObjSet,1)
Set.Add(ObjSet,2)
Set.Add(ObjSet,3)
// ObjSet = {1,2,3}

ObjSet1 = Set.Create()
Set.Add(ObjSet1,2)
Set.Add(ObjSet1,3)
Set.Add(ObjSet1,4)
// ObjSet1 = {2,3,4}

objSetRet = Set.Intersection(ObjSet,ObjSet1)
TracePrint(objSetRet)
/**
objSetRet = {2, 3}
*/