Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Please help.
Problem: Show finilist.
Interface : Only type name of two players and sport and score between the players. Calculate : (Win=3) (Loose=0) (Draw=1) (GoalDiff = Existing GoalDiff + Goal Scored less Goal Scored by other player)
Buttons: Submit - capture name of sport and score.
Display - Show finilist in a label
Prog' should work on any number of teams playing.Thanks in adv.

IR,
It's nice to see someone else getting bitchy here. I refrained from posting to this because I was in a REALLY bad mood last night (before watching football) and I was afraid I might offend the fiji.But, now I am in a better mood (and your last two posts that I read made me feel happy)
fiji,
Post some of what you have done so far and then let us know where your problem is. We would be much more open to helping someone who appears to actually be trying to code something than someone who just posts the assignment. (see some of the archives on this website and you'll understand just how everyone here feels about homework assignment posters)Chi Happens

Chi: I'm glad that I could make ya feel happy with my posts... :)
Fiji, I wasn't trying to be bitchy or mean with prior post... it is a simple fact that
us doing your homework for you will not help you get your degree, even if it did, you would not be productive in the workforce and couldn't hold a job.Perhaps, you can read your book... attempt the assignment and let us know when you have a specific problem after you tried to work it out first..
IR

Dim dblTeamA As String
Dim dblTeamB As String
Dim intScoreA As Integer
Dim intScoreB As Integer
Dim dblBest As Double
Dim dbl2ndBest As Double
Dim intBestpoints As Integer
Dim int2ndbestpoints As Integer
Dim intPoints As Integer
Dim intGoalDiff As Integer
Const intMax = 50
Dim StrBest As String
Dim Srt2ndBest As StringPrivate Sub cmdDisplayFinal_Click()
'Display
lblFinal1.Caption = StrBest
lblFinal2.Caption = Str2ndBest
End SubPrivate Sub cmdExit_Click()
'End the project
End
End Sub
Private Sub cmdSubmit_Click()
'Capture items
ValidResponce
Dim intScoreA As Integer
Dim intScoreB As Integer
intScoreA = Val(txtScoreA.Text)
intScoreB = Val(txtScoreB.Text)
If intScoreA = intMax Then
StrBest = txtTeamA.Text
Str2ndBest = txtTeamB.Text
End If
ClearForm
End SubPrivate Function ValidResponce()
If txtTeamA.Text = txtTeamB.Text Or _
txtScoreA.Text = "" Or txtScoreB.Text = "" Then
MsgBox "This pool game is invalid." _
, vbRetryCancel, "Invalid Game."
End If
End FunctionPublic Function ClearForm()
txtTeamA.Text = ""
txtTeamB.Text = ""
txtScoreA.Text = ""
txtScoreB.Text = ""
End Function
****not yet done ****post later.

Just a bit of constructive criticism:
Don't use END to end your application, use Me.UnloadSecondly (and maybe this is not too constructive)
Response is spelled R.E.S.P.O.N.S.E. so ValidResponce really should be spelled ValidResponse.And while I am on that subject...it is poor programming practive to not indicate that something is a sub or function call in vb.
So
ValidResponse
should be
Call ValidResponseThis makes it easier to follow the code.
You look like you are doing well so fa, one last suggestion: Use Collections instead of separate object. By this I mean:
txtTeamA.Text = ""
txtTeamB.Text = ""
txtScoreA.Text = ""
txtScoreB.Text = ""
could be easier to use if they were collections like:
txtTeam(0).Text
txtTeam(1).Text
and
txtScore(0).Text
txtScore(1).Textdoing so would also allow you to do things like:
For Index = 0 To txtScore.Count -1
txtScore(Index) = ""
Next IndexWhich really is not TOO helpful for two items, but VERY helpful if you wanted to add more text boxes in the future.
Chi Happens

Looking good so far...
Chi's control array (collections) recommedation would be beneficial to implement, especially in the long run. If you have particular problems with the code, let us know so we can try to get a resolution for you. :)IR

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |