These are the actions that can be performed by (or on) the object.
These are often actions that cause something to happen on an object.
It may or may not have a return value and is more likely to have parameters than a property.
The simplest method would have no parameters and no return type.
It is very common to have read-only properties but not write-only.
You can create functions that can be treated like a read-only property
When a write-only property is required a method is often used instead.
Methods can have parameters and a return type.
Methods can also have optional arguments.
A method can be thought of as an action for an object.
A method is an action that is associated with the object.
These are actions that can be performed.
These can only be applied to an object if that object supports it.
Methods may require extra information to be supplied as arguments.
Subroutines and Functions
Function and Sub procedures are used in class modules to create the methods of the object.
Public Function WeeklyPay() As Double
WeeklyPay = (mdbNormalHours + mdbOvertimeHours) * HourlyRate
© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext