View Single Post
  #2 (permalink)  
Old 10-01-2007, 03:23 AM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
Well, if you had the code:
Code:
Sub madeup()
  If (document.frmExample5a.txtAge.value < 0) Or _

     (document.frmExample5a.txtAge.value > 100) Then

    MsgBox "The age you entered is invalid."

    Exit Sub

  End If

'
'
'Information for processing information without checking things are valid.
'
'

End Sub
This i have made up a sub called "madeup", if i wanted to process some information, i may wish to check a value, the if statement does this, when it checks, say i put 101 in the box it will the start showing me the message box, when you click ok in the message box it will continue processing the rest of the code, Exit Sub comes next which means it will Exit the sub rather than it continuing to process the information regardless. (this means where i have put a comment in my code for more statements it wont read there.

Hope that helps, if i have confused you let me know lol.
Lee.
Reply With Quote
The Following User Says Thank You to Lee For This Useful Post:
TeraTask (12-24-2007)