VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 307,003 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,957 people online right now. Registration is fast and FREE... Join Now!




VB RANDOM NUMBER GENERATOR NO REPEATS

 

VB RANDOM NUMBER GENERATOR NO REPEATS

TOEMAIN

31 Oct, 2009 - 03:04 PM
Post #1

New D.I.C Head
*

Joined: 31 Oct, 2009
Posts: 2

CODE

Private Sub Image1_Click()

Dim A As Integer
Dim B(0 To 5) As Integer
Dim i, x, y As Integer
Randomize
Cls
Label1.Caption = " "
For x = 0 To 5
'Print " "
TOM:
A = Int((6 * Rnd()) + 1)
For y = 0 To 5
If A = B(y) Then GoTo TOM
Next y
B(x) = A
Next x
  For i = 0 To 5
  Label1.Caption = Label1.Caption & (B(i)) & " , "
Print i + 1, B(i)
'Print B(i)
Next
End Sub


Mod Edit:
When posting code please use code tags like below.
code.gif

User is offlineProfile CardPM
+Quote Post


GenHornet18

RE: VB RANDOM NUMBER GENERATOR NO REPEATS

31 Oct, 2009 - 03:52 PM
Post #2

D.I.C Head
**

Joined: 19 Oct, 2009
Posts: 113



Thanked: 4 times
My Contributions
Well to start with your going to have to elaborate I have a general understanding of your code but what is the problem?
User is offlineProfile CardPM
+Quote Post

PsychoCoder

RE: VB RANDOM NUMBER GENERATOR NO REPEATS

5 Nov, 2009 - 10:14 AM
Post #3

I Code, Therefore I am
Group Icon

Joined: 26 Jul, 2007
Posts: 14,919



Thanked: 517 times
Dream Kudos: 11525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 06:45AM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month