Click here to Skip to main content
16,007,687 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: insert multiple listbox text to database. Pin
sumit52833-Dec-08 19:14
sumit52833-Dec-08 19:14 
GeneralRe: insert multiple listbox text to database. Pin
Mycroft Holmes3-Dec-08 19:41
professionalMycroft Holmes3-Dec-08 19:41 
GeneralRe: insert multiple listbox text to database. Pin
Paul Conrad4-Dec-08 5:02
professionalPaul Conrad4-Dec-08 5:02 
GeneralRe: insert multiple listbox text to database. Pin
sumit52834-Dec-08 17:31
sumit52834-Dec-08 17:31 
QuestionLotto Program Challenge..how would you create this program? Pin
creelo3-Dec-08 17:36
creelo3-Dec-08 17:36 
AnswerRe: Lotto Program Challenge..how would you create this program? Pin
Christian Graus3-Dec-08 18:17
protectorChristian Graus3-Dec-08 18:17 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
creelo3-Dec-08 18:37
creelo3-Dec-08 18:37 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
Christian Graus3-Dec-08 18:58
protectorChristian Graus3-Dec-08 18:58 
This is VB.NET, right ?

An array is a collection of objects, I am not sure of the syntax to create one in VB. I never use arrays because they are fixed size, I prefer to use a list. However, if you have an array of five objects, then they are accessed by index.

If n is your array, n(0) is the first int, and n(4) is the last one. So you create a loop, such as:

dim i as int

for(i = 0 to 4)

n(i) = i;
end for

This would assign the values of 0 to 4 to your five numbers.

Again, I don't do VB, so my syntax may be a little wrong, I'm doing the best I can Smile | :)

So, you will create an array of 5 ints. You will use a loop to assign random numbers to these values. He's allowing you to have duplicates to simplify the creation, you get a random number and you don't need to check if it's in there already. But, I would say the best way to check if the two sets are the same, is to iterate over both at once, and count how many times each of the 10 values is in there. If 0 is in the your lot twice, you need to count that it's also in the users selection twice, for example.

I would therefore create another array to store the users entry, to simplify the code that does the checking.

Christian Graus

Driven to the arms of OSX by Vista.

GeneralRe: Lotto Program Challenge..how would you create this program? Pin
Mycroft Holmes3-Dec-08 19:44
professionalMycroft Holmes3-Dec-08 19:44 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
Paul Conrad4-Dec-08 5:05
professionalPaul Conrad4-Dec-08 5:05 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
Guffa3-Dec-08 20:17
Guffa3-Dec-08 20:17 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
MatthysDT3-Dec-08 20:49
MatthysDT3-Dec-08 20:49 
GeneralRe: Lotto Program Challenge..how would you create this program? Pin
creelo4-Dec-08 11:53
creelo4-Dec-08 11:53 
QuestionSerial Communication Pin
Subjugate3-Dec-08 15:24
Subjugate3-Dec-08 15:24 
AnswerRe: Serial Communication Pin
Christian Graus3-Dec-08 15:43
protectorChristian Graus3-Dec-08 15:43 
GeneralRe: Serial Communication Pin
Luc Pattyn3-Dec-08 17:51
sitebuilderLuc Pattyn3-Dec-08 17:51 
GeneralRe: Serial Communication Pin
Subjugate3-Dec-08 18:27
Subjugate3-Dec-08 18:27 
GeneralRe: Serial Communication Pin
Dave Kreskowiak3-Dec-08 18:41
mveDave Kreskowiak3-Dec-08 18:41 
GeneralRe: Serial Communication Pin
Christian Graus3-Dec-08 19:00
protectorChristian Graus3-Dec-08 19:00 
GeneralRe: Serial Communication Pin
Dave Kreskowiak4-Dec-08 1:58
mveDave Kreskowiak4-Dec-08 1:58 
Questionproject sample book Pin
Dave Pursey3-Dec-08 14:06
Dave Pursey3-Dec-08 14:06 
AnswerRe: project sample book Pin
Christian Graus3-Dec-08 14:17
protectorChristian Graus3-Dec-08 14:17 
QuestionString as Executable Code Pin
User 54091903-Dec-08 13:03
User 54091903-Dec-08 13:03 
AnswerRe: String as Executable Code Pin
Christian Graus3-Dec-08 13:53
protectorChristian Graus3-Dec-08 13:53 
QuestionHow can I make this loading animation work right? Pin
ikantspelwurdz3-Dec-08 6:52
ikantspelwurdz3-Dec-08 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.