If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

how to break repeating random

hi guys any one can help me out for this problem..
i create a fuction to generate all the question. also this fuction have a random how can i put a code to break the repeting random.. thanks
here my sample code

Code:

Public Function Generat1n()
Dim j As Integer
Open App.Path & "\Questions.mezz" For Input As #1
j = Int(Rnd * 12)
For i = 0 To j
Line Input #1, question
Next i
Label1.Caption = question
Close #1
End Function

Re: how to break repeating random

If you only want each question to be asked once then one option would be to load the entire file into a listbox at the beginning (form_load)
Also put the call to Randomize in Form_Load

When you want to get a question use the rnd in the range of 0 to listcount-1 to get a question from the list and then remove that question from the list
This way you will get the questions asked in random order and will not get the same question twice