There's no while loop in c2.
The only sure way I know to do a sampling without replacement is to make a list of your sample, pick one at random, delete the sample from the list.
I showed an implementation not long ago.
It went a bit like that:
global sampleCount = 3 // number of... number you want
+System: on start of layout
-> Array: set size to sampleCount,1,1
+On What you want
Local text list = "0,1,2,3,4,5,6"
+repeat sampleCount times
-> Array: set value at loopindex to int((tokenat(list,floor(random(tokencount(list,","))),",")))
-> System: set list to replace(list,str(Array.At(loopindex)),"")
-> System: set list to replace(list,",,",",")
-> System: set list to (left(list,0,1) = ",") ? right(list,len(list)-1) : list
-> System: set list to (right(list,len(list-1),1) = ",") ? left(list,len(list)-1) : list
The four last actions are used to delete the token from the list string. This way you don't pick it again.
-> System: set list to replace(list,Array.At(loopindex),"")
Delete the token leaving the comas
1,2,3 -> ",2,3" or "1,,3" or "1,2,"
-> System: set list to replace(list,",,",",")
Check if there's two comas side to side and delete one
1,2,3 -> ",2,3" or "1,3" or "1,2,"
-> System: set list to (left(list,0,1) = ",") ? right(list,len(list)-1) : list
Check if the first character is a coma and delete it
1,2,3 -> "2,3" or "1,3" or "1,2,"
-> System: set list to (right(list,len(list-1),1) = ",") ? left(list,len(list)-1) : list
Check if last character is a coma and delete it
1,2,3 -> "2,3" or "1,3" or "1,2"