Sunday, August 9, 2009

Revision - Ch 8

Defining A Function - what values need to be passed into the function

Public Function MultiplyAge(intAge As Integer)
intAge = intAge * 3
return intAge
End Function

Procedure

Public Sub MultiplyAge(intAge As Integer)
intAge = intAge * 3
End Sub

Try-Catch Structure

Detects exceptions and takes corrective action
"Try" - to execute this code
"Catch" - errors here

starts with specific exception - ends with generic exception

Commonly used:
FormatException = most common
OverflowException = follows
SystemException = finish with

Everything in the Try-Catch will be done as a block

No comments:

Post a Comment