'These next 4 functions all share the same name, but it allows the 'programmer to supply various levels of initialisation data without 'having to write several different functions... ' 'The compiler will decide exactly which procedure to call depending on 'how the procedure is actually called. ' 'This is very useful when combined with the inheritance sample code... 'a derived class could implement a new "Initialise" function with a set of 'custom parameters... that way each window (for example) could have different 'initialisation routines, but effectively share a common interface...
Public Overloads Sub InitialiseUDT()
'no parameters here, either fail the call or fill
'the UDT with some default set of data and hope its sorted out later :)
End Sub
Public Overloads Sub InitialiseUDT(ByVal sName As String)
'this time we have a name, so we can put the name into the UDT,
'but we'll have to use a default set of variables for the other
'members of the UDT...
End Sub
Public Overloads Sub InitialiseUDT(ByVal sName As String, _
ByVal i64Identifier As Int64)
'Getting more information this time... but we still need to decide on default values
'for any other parameters in the UDT.
End Sub
Public Overloads Sub InitialiseUDT(ByVal sName As String, _
ByVal i64Identifier As Int64, _
ByVal bSaveDataToFile As Boolean)
'Assume that this function has parameters for ALL of the UDT's members, so we can do a full
'initialisation. Excellent :)
End Sub
|