Monday, August 10, 2009

Chapter 8 revise and finalise.

Chapter 8 completed,


In class we worked on functions.



Public function MultiplyAge(intAge As Integer) As Integer


intAge = intAge *3

Return intAge Multiply age(*)
End Function

" This can also be used as a procedure by changing the public function to a Public sub."

Public Sub MultiplyAge(intAge As Integer) As Integer

lbl = intAge lbl.text = Multiply age(*)

End Sub

Try-catch

User not entering numbers,
Also fixes errors.

A bad thing can happen or a few bad things can happen and so a try-catch statement is used to make sure that what is entered is a number and not text.

Over flow exception = a value exceeds its assigned data type.
Format exception = a varaible is converted to another type that is not possible.

No comments:

Post a Comment