Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

Newb question/Introduction

$
0
0
Hey guys my name is Steve, I'm a huge forum geek but this is my first time venturing over to the VB forums. I'm usually over in the S4 car forums and have been posting in/on/around forums for over a decade. I just got back into school and like a cocky *******, I figured I could handle 2 VB classes. One is VB6 which I've caught onto a lot easier than my other which is VB.Net. I hear they're still very different and i'm hardly managing since my VB.Net teacher isn't much of one.:mad:

Anyway, i'm working on an assignment with my VB6 class right now and i'm having an issue figuring out where to go from here. Remember, i'm a super newb and I'm still learning what does what so be gentle :o
Could someone point me in the right direction to figure the average of 3 numbers? I'm having trouble under " 'Calculate average rainfall "
Thanks in advance!!

Private Sub cmdCalc_Click(Index As Integer)
'If error occurs, go to end of the routine to print error message
On Error GoTo ErrorHandler

'Calculate average rainfall
lblTotal.Caption = Fix(Val(txtAvg1.Text) + _
Val(txtAvg2.Text) + Val(txtAvg3.Text)) / 3)
Exit Sub

'Error handler
ErrorHandler:
MsgBox ("The values you entered resulted in an error. Try Again.")
Exit Sub
End Sub

Private Sub cmdExit_Click(Index As Integer)
End
End Sub

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>