On Sat, 14 Mar 1998 23:21:43 -0800, "MICHAEL FAITH"
Quote:
>I have spent 10 hours on this project with no progress. If you would be so
>kind as to provide more assistance, I would be forever grateful. I'm lost in
>the logic of this program, and it seems that the more time I spend on this
>project, the more I get confused. I've completed the form, and have assigned
>the properties. I completed the code, in (For/Next loops) for the controls,
>and lbl2, and now I'm hung up on the Command1_Click event procedure.
>The assignment reads like this:
>In the Command1_Click event procedure, assign the clicked button's value to
>the next judge's score. In other words, the first click is the score for
>Judge 1 and replaces the caption in Label1(0). The next click provides the
>scare for Judge 2, and so on.
>When the score for Judge 5 is recorded, the program should automatically
>calculate the average score and display it in the caption for Label4. The
>score should be accurate to one decimal place. "Adapted from Spear & Spear"
You want to use the same commandbutton to calcaulate different scores?
One method is the following:
Sub Form_load
command1.caption = 'first"
'....
End Sub
Sub Command1_Click
select case command1.caption
case "first"
command1.caption = "second"
label1(0).caption = cstr(judge(0))
case "second"
command1.caption = "third"
label1(1).caption = cstr(judge(1))
case "third"
command1.caption = "fourth"
label1(2).caption = cstr(judge(2))
case "fourth"
command1.caption = "fifth"
label1(3).caption = cstr(judge(3))
case "fifth"
command1.caption = "first"
label1(4).caption = cstr((judge(1) + judge(2) + _
judge(3) + judge(4)) /4)
end select
End Sub
To use decimals see the help on Format..
good luck
gr. Walther
----- it's the line -----
Walther Musch; Tilburg University
http://pi1438.kub.nl:2080/VisualBasicSource/