| | |
vb dot net arrays
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 14
Reputation:
Solved Threads: 0
i want to store multiple values in an array. lets say the variable name is voternumber which is a unique number that is generated which is between 1 and 5000. i will output the voternumber to a voter and then as them to input it so that i can perform a check to see wether it has been used before or not. To do this i will need to store all the unique voter numbers, i do not know how to do this i know of arrays but dont know how to add to them b clicking buttons.
Please help and elaborate by giving an example. thanks a lot. if not using arrays could you please explain any other method.
Please help and elaborate by giving an example. thanks a lot. if not using arrays could you please explain any other method.
Last edited by asif786; Jan 3rd, 2009 at 12:15 pm.
- List or ArrayList can be used for better reasons. and It contains
- Use Random class to generate numbers but check if the generated number is has been generated before or not.
.Contains method which to be used in your case.- Use Random class to generate numbers but check if the generated number is has been generated before or not.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
vb.net Syntax (Toggle Plain Text)
Dim numbers As List(Of Int32) while(numbers.Count > 100) { if Not numbers.Contains(GetRandomNumber()) numbers.Add(GetRandomNumber()) }
Last edited by Ramy Mahrous; Jan 3rd, 2009 at 3:26 pm. Reason: I wrote C# code instead of VB.NET!
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- How to configure GD (PHP)
- what kind of c++ for games (C++)
- vb6 to vb.net conversion problems (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Using the table adapter in vb.net 2008
- Next Thread: What ListBox properties do I set to...
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary box button buttons center click code combo combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall listview login math memory mobile module ms msaccess mssqlbackend mysql navigate net opacity pan peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog search serial sorting sqldatbase storedprocedure string temp textbox timer updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml






