at school in visual studio 2013 I'm trying to get a program to add 100 different things (one is names, one is numbers) in visual studio, and then I need to check for the highest scorers name and mark. In order to get the name from this, I need to have a loop and a counter added around the 2 lines of code to find the name. I haven't brought it home with me so I can't explain the other problems but I can at least remember this
counter2 = 0
Do
For counter = 1 to 50
counter2 = counter2 + 1 ' this increases with the loop, it's the "identifier"
HighestScorer = FullName(counter2) ' FullName is the name of the array that stores all 50 of the names
Next
Loop until counter2 = 50
now I've just realised something that will probably give me wrong information somewhere else, but the REAL problem is that when I run this program and run this code, the entire program freezes. like it doesn't even throw a breaking point, but I can fix this if I simply remove the loop:
counter2 = 0
counter2 = counter2 + 1
HighestScorer = FullName(counter2)
this works, if I run the code counter2 is going to increase by 1 up to 2, and then HighScorer = FullName(counter2) uses counter 2 to find something in the array, so it will now list the name stored in value 2 of the array
I have tried setting counter 2 to a number like 3 and I can confirm that this works, this outputs the correct info, but that's not useful enough because I need it to check the entire list but it can't because the loop breaks it. What I want to know is why the program just seizes up and never gets to the end of that loop? shouldn't the counter get to 50 and display that arrays value? I'm probably being super dumb by not posting the rest of the code, but I see no reason why that loop shouldn't work