| | |
Vb dot net Array loop?
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
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
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code combobox component convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output passingparameters peertopeervideostreaming picturebox picturebox1 port print printing problem problemwithinstallation project remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer toolbox trim update updown user validation vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web winforms wpf





