Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2004, 07:34 AM
Authorized User
 
Join Date: Sep 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Brettvan1
Default Could somebody help me finish this code

Ok so thanks to your help I have come up with this code so far...
This is giving me random numbers, but now I cant seem to get them into ascending order.Could anyone help me with this?

dim intarray(49) as integer
dim intcount as integer
dim intindex as integer
dim repeated as boolean
dim obj as object

label1.text=intarray(0)
label2.text=intarray(1)
label3.text=intarray(2)
label4,text=intarray(4)
label5.text=intarray(5)
label6.text=intarray(6)

For intcount=0 to 5
Do
repeated=false
intnumber=int((50 * rnd())+1)

for intindex=0 to 5
if intnumber=intarray(intindex) then
repeated=true
end if
Next
Loop until repeated=False

intarray(intcount)=intnumber

Next
intindex= -1
for each obj in groupbox1.controls
intindex+=1
obj.text=intarray(intindex)

Next
end if


 
Old October 1st, 2004, 08:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Please don't post the same thing to two different topics.

This was also posted here:

http://p2p.wrox.com/topic.asp?TOPIC_ID=19958

J
 
Old October 1st, 2004, 08:11 AM
Authorized User
 
Join Date: Sep 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Brettvan1
Default

Sorry.Wont do it agai.

 
Old October 10th, 2004, 12:37 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When generating random number you cannot generate in Ascending order, you can generate it and you can sort that.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa
 
Old October 10th, 2004, 12:38 AM
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

May be you can check some algorithms that can generate random numbers in ascending order and implement it.



It is not how much we do,
but how much love we put in the doing.

-Mother Theresa





Similar Threads
Thread Thread Starter Forum Replies Last Post
Wizard Finish Step Approach AspNetGuy ASP.NET 3.5 Basics 0 June 17th, 2008 05:15 PM
About to finish the book?!! ukamed BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 May 22nd, 2008 06:23 PM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
Waiting for a batch file to finish fordrs3 Beginning VB 6 3 June 22nd, 2003 04:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.