•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 427,222 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,280 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 494 | Replies: 4 | Solved
![]() |
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,290
Reputation:
Rep Power: 4
Solved Threads: 83
•
•
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 459
Reputation:
Rep Power: 1
Solved Threads: 79
Hi, Rnd () function generates random number.
This code generates 0 or 1 randomly
vb Syntax (Toggle Plain Text)
Dim iNumber As Integer Randomize iNumber = Int(2 * Rnd) If iNumber = 1 Then 'Head Else 'Tail End If
This code generates 0 or 1 randomly
KSG
•
•
Join Date: Jul 2008
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 6
rnd is tricky one every time you start application it will to same order for example make it in command button first time you click it will flip 1 second 1 third 1 fourth 0 fifth 0.
You need to replace that number 2 with some number that can't be so much predicted such as date + time numbers and look will resolut be odd or even.
Or you can just make timer with interval 1 make integer when timer activate incerease that integer by one and if that integer is bigger then 1 make it 0 that really hard to predict.
You need to replace that number 2 with some number that can't be so much predicted such as date + time numbers and look will resolut be odd or even.
Or you can just make timer with interval 1 make integer when timer activate incerease that integer by one and if that integer is bigger then 1 make it 0 that really hard to predict.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Please check my code below (Java)
- Dictionary Sorting? (Python)
- When a host says "included scripts" (Networking Hardware Configuration)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: disable changeable property of text, combo, listbox
- Next Thread: ivrs project



Linear Mode