| | |
Vb dot net Array loop?
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2008
Posts: 14
Reputation:
Solved Threads: 0
I am constructing an array in Vb .NET for a voting simulation program, i want it to store numbers which are being generated these will be unique numbers to each voter and then perform a check to see if the number input by the user matches those stored in the array.
The numbers generated are sequential i.e. 1,2,3 adding 1 each time here is my code;
As you can see i had a try but it does not work for some reason, thanks a lot
The numbers generated are sequential i.e. 1,2,3 adding 1 each time here is my code;
VB.NET Syntax (Toggle Plain Text)
Private Sub genrandomnum() counter = counter + 1 count = counter MsgBox("You're voter number is" & count) j = 5000 j = j - 1 j = k count = votearr(k) End Sub Private Sub btnvoternumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnvoternumber.Click Call genrandomnum() End Sub Private Sub btnvoternum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnvoternum.Click voternumcheck = InputBox("Please input voter number") booFound = False For k = 5000 To LBound(votearr) If voternumcheck = votearr(k) Then MsgBox("Value matched at k=" & k) Else MsgBox("Value was not found in array") End If Next k End Sub
As you can see i had a try but it does not work for some reason, thanks a lot
I will speak on my self when I say I did not understand how your array should work, and I guess that is the reason why you did not got an answer so far, so I suggest the following
- you already post your pseudo-code so we know you had tried
- I suggest posting algorithm of what you want (by words not by code)
- you already post your pseudo-code so we know you had tried

- I suggest posting algorithm of what you want (by words not by code)
![]() |
Similar Threads
- Tutorial: Understanding ASP classes (ASP)
- Arrays help? (VB.NET)
- vb dot net help (VB.NET)
- [Warning] address of local variable returned??? (C++)
Other Threads in the VB.NET Forum
- Previous Thread: new to vb.net
- Next Thread: deployment
Views: 1035 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access application arithmetic array assignment basic binary box button buttons center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net error excel firewall folder highlighting image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net opacity pan peertopeervideostreaming picturebox picturebox1 plugin port print printing printpreview problem problemwithinstallation project record reports" reuse save savedialog serial server sorting sql storedprocedure string structures studio temp textbox timer updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





