Use an outer for each loop and an inner while loop to iterate types AFTER the current one while not null...
Type mytype Field num End Type For i=1 To 7 m.mytype=New mytype m\num=i Next For b.mytype=Each mytype c.mytype=After b While c<>Null Print "Comparing "+b\num+","+c\num c=After c Wend Next WaitKey()