Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to start a sub program but wont work

Status
Not open for further replies.

corriejgreen

IS-IT--Management
Mar 2, 2013
2
GB
Call inputs(minibeast(index), coordinate, index)

Do
index = index + 1

minibeast(index) = InputBox("enter number of minibeast")

lst_display.Items.Add(minibeast(index))

coordinate = InputBox("enter the coordinate of minibeast")

lst_coordinate.Items.Add(coordinate)


If minibeast(index) = 1 Then how_many_slug = how_many_slug + 1

txt_how_many_slugs.Text = how_many_slug

If minibeast(index) = 2 Then how_many_centipede = how_many_centipede + 1

txt_how_many_centipded.Text = how_many_centipede

If minibeast(index) = 3 Then how_many_lady = how_many_lady + 1
txt_how_many_lady.Text = how_many_lady

If minibeast(index) = 4 Then how_many_snail = how_many_snail + 1

txt_how_many_snail.Text = how_many_snail

If minibeast(index) = 5 Then how_many_woodlouse = how_many_woodlouse + 1

txt_how_many_woodlouse.Text = how_many_woodlouse

If minibeast(index) = 6 Then how_many_worm = how_many_worm + 1

txt_how_many_worm.Text = how_many_worm



Loop Until minibeast(index) = 7



End Sub





Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
End
End Sub



End Class



private sub inputs (ByRef minibeast(index) As Integer, coordinate As String, index As integer)





i need to make 2 sub progrrams here, one for the inputbox's and another for the if statements and still loop. Its not working, ive tried my best now i need help :( please! Also if you know a way to actually stop the inputbox's from appearing when 7 is hit, loop until = "7" doesnt work :/

ta
 
You're using a DO UNTIL construct which means that the loop will be executed before the termination condition is tested. That's opposed to a DO WHILE construct which means the termination condition is tested before the loop is executed.

The value of index is set to 7 at the beginning of the loop, but it's not tested as an termination condition until the end of the loop.


--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
Wise men speak because they have something to say, fools because they have to say something. - Plato
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top