|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Data Structure
Hi all,
I am having a problem getting this program to work. The object of the program is: 1. When run the user inputs 4 players names and scores (any names can be entered and scores between 0 and 1000 can be entered via input box) 2. When all 4 names and scores have been inputed the program should display the names and scores of the players in a pic box, then calculate and display an average score. I have tried and tried to get it to work, any help from you guys would be greatly appreciated. Kind regards, Kia. Attachment enclosed. |
|
#2
|
|||
|
|||
|
What's your wrong??Your program is run incorrectly??
|
|
#3
|
||||
|
||||
|
WHOOOHOOO!!! Indiscriminate errors! ... just kidding kia
. What's the problem... CP and I can solve it!
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#4
|
||||
|
||||
|
Ok.. kia.. when I tried to run the code.. I ran into the following problem
Code:
Private Sub cmd_START_Click()
Dim Player(1 To 4) As Netball
Dim intScore As Integer
For i = 1 To 4
Playeri.intScore = InputBox("Score")
Do While Playeri.IngScore < 0 Or Playeri.IngScore > 1000
MsgBox "Error:Enter number between 0 and 1000", vbOKOnly, "Error"
Playeri.IngScore = InputBox("Score")
Loop
Playeri.strName = InputBox("Name")
Next i
End Sub
Your not using arrays correctly. IN the line Playeri.intScore = InputBox("Score") and every other line where "Playeri" is used, it should be an array declaration, such as Player(i). Also, in the do loop, you have Playeri.ingscore instead of Player(i).intscore |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Data Structure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|