|
|
Hello, Guest! Welcome to Symbianize forums.
Most of our features and services are available only to our members. So we encourage you to login or join us by registering a new account. Registration is free, fast, and simple. You only need to provide a valid email address so we can minimize spammers. As a Symbianize member you'll have the following privileges:
- Gain access to private forums and restricted features
- Reply and create new topics or polls
- Download free applications, games, themes, graphics, tones, videos, etc.
- Ask question or support related to mobile phone, computer, game console, and multimedia
- Private messaging (PM) with fellow members
- Communicate instantly or real-time with currently online members via Shout Box
All that and more, so what are you waiting for, join us now! Ito ang website na ginawa ng pinoy para sa pinoy!
| |
| Programming Discussions related to C++, HTML, PHP, ASP, ColdFusion, JavaScript, Perl, Phyton, Ruby, WML, SQL, XML, and other programming languages. |
 |

14th Feb 2011 Mon, 16:54
|
 |
Forum Advisor
|
|
Join Date: Mar 2010
Posts: 695
Reputation:
|
|
random vb6
paano po kumuha ng random questions sa database??
|

14th Feb 2011 Mon, 17:11
|
 |
Expert
|
|
Join Date: Oct 2009
Posts: 215
Reputation:
|
|
Re: random vb6
Quote:
Originally Posted by rexson98
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...
|

14th Feb 2011 Mon, 17:20
|
 |
Forum Advisor
|
|
Join Date: Mar 2010
Posts: 695
Reputation:
|
|
Re: random vb6
paano po ung hindi na ma uulit ung question?
|

14th Feb 2011 Mon, 17:24
|
 |
Expert
|
|
Join Date: Oct 2009
Posts: 215
Reputation:
|
|
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
|
 |
All times are GMT +8. The time now is 13:13.
|