943,648 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 907
  • VB.NET RSS
Feb 13th, 2009
0

VB Array values

Expand Post »
i am coding a program in vb.NET, it will be used for people to vot for their favourite food. I have let the users input the name of favoutie foods into an inputbox and tehn store the name of each favoutie food into an array called foodarray.

Then the array outputs each item inside it into a checkedlistbox, which will be used to vote from by the voters.

The problem is that i want to add 1 to the value of the name of the food each time it is selected by a user. How do i do this, i want to add 1 to the names in the foodarray to find out how many votes each food gets.

thanks a lot
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
asif786 is offline Offline
19 posts
since Dec 2008
Feb 13th, 2009
0

Re: VB Array values

You could use a Dictionary to create a set of key-value pairs. You could use the name of the food as a string key and the votes as an int value.

http://msdn.microsoft.com/en-us/library/xfhwa508.aspx
Reputation Points: 23
Solved Threads: 10
Light Poster
bcasp is offline Offline
45 posts
since Apr 2008
Feb 13th, 2009
1

Re: VB Array values

You could also use a dictionary to check spelling
Reputation Points: 155
Solved Threads: 41
Posting Whiz in Training
rapture is offline Offline
294 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC