Symbianize





Programming Discussions related to C++, HTML, PHP, ASP, ColdFusion, JavaScript, Perl, Phyton, Ruby, WML, SQL, XML, and other programming languages.

Reply
  #1  
Old 14th Feb 2011 Mon, 16:54
rexson98's Avatar
rexson98 Male rexson98 is offline
Forum Advisor
 
Join Date: Mar 2010
Posts: 695
Reputation: rexson98 is an unknown quantity at this point
Default random vb6

paano po kumuha ng random questions sa database??


Reply With Quote
Other Resources
  #2  
Old 14th Feb 2011 Mon, 17:11
miste3rio's Avatar
miste3rio Male miste3rio is offline
Expert
 
Join Date: Oct 2009
Posts: 215
Reputation: miste3rio is an unknown quantity at this point
Default Re: random vb6

Quote:
Originally Posted by rexson98 View Post
paano po kumuha ng random questions sa database??
Just randomize the ID of each question.

something like this

if you have a table of Question that with ID, Question, Answer field

ID, Question, Answer
1, ..... ,.....
2, .... , ...

Just randomize the value of ID Field...



Weather Weather lng...
My Thread
OM 5.1 Shiangtao Transparent Background No need to Activate
http://symbianize.com/showthread.php?t=348234
Reply With Quote
  #3  
Old 14th Feb 2011 Mon, 17:20
rexson98's Avatar
rexson98 Male rexson98 is offline
Forum Advisor
 
Join Date: Mar 2010
Posts: 695
Reputation: rexson98 is an unknown quantity at this point
Default Re: random vb6

paano po ung hindi na ma uulit ung question?


Reply With Quote
  #4  
Old 14th Feb 2011 Mon, 17:24
miste3rio's Avatar
miste3rio Male miste3rio is offline
Expert
 
Join Date: Oct 2009
Posts: 215
Reputation: miste3rio is an unknown quantity at this point
Default Re: random vb6

Try to understand this example:

Code:
Private Incre As Integer
Private xt(9) As Integer
Private Sub Command1_Click()
Dim i() As Integer
Dim x As Integer
Dim r As Boolean




Command1.Enabled = False
r = True
Do ' infinite loop
    Randomize
    x = Fix(Rnd(1) * 10)
    If x = 0 Then x = 1
    For j = 0 To 8
        If x = xt(j) Then
           r = True
           Exit For
        Else
           r = False
        End If
    Next
    
    If r = False Then
        xt(Incre - 1) = x
        Label1.Caption = x
        Command1.Enabled = True
        Exit Do
    
    End If
Loop
Incre = Incre + 1
If Incre = 10 Then
MsgBox "asdfasdfasdF"
For x = 0 To 8
    Debug.Print xt(x)
Next
End If
End Sub


Private Sub Form_Load()
Incre = 1
End Sub



Weather Weather lng...
My Thread
OM 5.1 Shiangtao Transparent Background No need to Activate
http://symbianize.com/showthread.php?t=348234
Reply With Quote
Reply

Thread Tools

Forum Jump


All times are GMT +8. The time now is 13:13.