'draw 10 numbers out of 10 without repeating numbers
'maybe dirty coding, but it seems to work 
Dim i as Integer
Dim j as Integer
Dim Rn(10) as Integer
Rn(1) = Rnd * 10 + 1
For i = 2 to 10
Rn(i) = Rnd * 10 + 1
For j = 1 to i-1
If Rn(i) = Rn(j) then
Rn(i) = Rnd * 10 + 1
i = i-1
End if
next
next
'for i = 1 to 10
’
'Label1(i).Text = Rn(i).totext
’
'next
’ Please have a good day, Rolf 
kevin_g
(kevin g)
2
A simpler solution would be to fill the array with the numbers 1 to 10 and then shuffle the array.
https://documentation.xojo.com/api/language/shuffle.html
5 Likes
Sascha_S
(Sascha S)
3
Var myArr() As Integer
For X As Integer = 1 To 10
myArr.Add X
Next
myArr.Shuffle
Just because a short example/snippet is always welcome 
3 Likes
Thank you for your replies, Kevin and Sascha

I did not know about the shuffle until now…
Yours, Rolf
1 Like