Computing.Net > Forums > Programming > newb vb 6 user

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

newb vb 6 user

Reply to Message Icon

Name: fate fiji
Date: September 4, 2003 at 16:57:45 Pacific
OS: xp pro
CPU/Ram: 512
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Infinite Recursion
Date: September 4, 2003 at 22:48:55 Pacific
Reply:

Thanks for posting your homework assignment, care to enlighten us with a question?

IR


0

Response Number 2
Name: Chi Happens
Date: September 5, 2003 at 05:03:16 Pacific
Reply:

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


0

Response Number 3
Name: Infinite Recursion
Date: September 5, 2003 at 11:59:21 Pacific
Reply:

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


0

Response Number 4
Name: fiji
Date: September 5, 2003 at 17:50:29 Pacific
Reply:

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 String

Private Sub cmdDisplayFinal_Click()
'Display

lblFinal1.Caption = StrBest
lblFinal2.Caption = Str2ndBest
End Sub

Private 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 Sub

Private 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 Function

Public Function ClearForm()

txtTeamA.Text = ""
txtTeamB.Text = ""
txtScoreA.Text = ""
txtScoreB.Text = ""
End Function
****not yet done ****post later.


0

Response Number 5
Name: Chi Happens
Date: September 5, 2003 at 19:35:37 Pacific
Reply:

Just a bit of constructive criticism:
Don't use END to end your application, use Me.Unload

Secondly (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 ValidResponse

This 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).Text

doing so would also allow you to do things like:
For Index = 0 To txtScore.Count -1
    txtScore(Index) = ""
Next Index

Which really is not TOO helpful for two items, but VERY helpful if you wanted to add more text boxes in the future.

Chi Happens


0

Related Posts

See More



Response Number 6
Name: Infinite Recursion
Date: September 7, 2003 at 03:26:16 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: newb vb 6 user

Declaring Variables in VB 6.0 www.computing.net/answers/programming/declaring-variables-in-vb-60/9957.html

Visual Studio 2005 on VB 6.0 www.computing.net/answers/programming/visual-studio-2005-on-vb-60/13978.html

VB 6.0 Coding www.computing.net/answers/programming/vb-60-coding/18507.html