Post by Mayayana Post by R.Wieser
FormatDateTime(date, value) 'system function
FormatDateTime(date, formatting string) 'my function
I guess I don't get it. Overloading would be to
have one function work differently depending on
parameters. You're just asking if you can use
an existing keyword or function name and somehow
hope that WSH doesn't notice.
Overloading in the current C languages supports multiple methods with the same
name but different parameters; - which combo of params you use determines which
version the compiler uses.
I've been doing similar in VB_ projects for years by passing an action index to
a single function to tell it what to do; - the function may also have other
args but the only one I use for Format_DateTime() is an index to tell it which
date or time format to return.
I'm in the process of converting all my stuff to C# and so far all is going
well. While it's possible to convert my multi-task functions to overloaded
ones, I don't yet see their point (other than to simplify naming and persist
further support of unnecessary bloating)! Single multi-task functions use
'Case' branching for actions to take for a common purpose. For example, my
GetInfo_FromWMI() function contains all the code necessary for all the various
WMI queries I use for my licensing methodology to return a delimited string for
a license profile MachineID property consisting of:
Make, Model, Mainboard SerialNumber,BIOS SerialNumber
The process involves using GoTo statements to control the order the info is
collected from the various WMI classes when the 'Case' statements don't
necessarily follow any order. This has been working well for 15+ years and so I
don't see any point in 'breaking' it just because the .NET Framework supports
the 'new and improved' feature of method overloading.
Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!