Re: Modules
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Wed, 23 Aug 2006 00:12:02 -0700
"WebBiz" <justask@xxxxxxxxxxxxxxxxx> wrote in message
news:IUQGg.460$B14.178@xxxxxxxxxxxxx
I can't help feeling I'm missing something very powerful with these 'classes'.
Having started out as a top-down type of programmer from the 70's may have
skewed my perspective beyond repair. I've read the C++ manuals back when they
first came out and went "Oooh, that's cool". But can't seem to arrive at a
point where I'd create some base object with some core features, then start
adding to it via inheritance and all that.
Various thoughts:
I use classes so routinely, I would reverse the question: why make a module when
you can make a class? If I make a class and create only one instance of it,
available from start to finish in a program, it has everything a module does.
(Okay, it can't contain a callback function for those timer API calls).
In VB6, the following are classes: all forms; all controls; all collections; all
user controls; the App, Screen, Clipboard, Printer, and Err objects; all DAO and
ADO connections, recordsets, and fields. All events are raised by classes.
You can make a class with no properties and just a single function. You can make
a class with 327 properties, and no functions. Make whatever sort of widget you
need. The Form class has 65 properties, 22 methods, and 31 events (or so). The
Timer control has 6 properties, 0 methods, and 1 event. The Collection class has
0 properties, 5 methods, and 0 events.
VB6 doesn't do inheritance, but it does do interface implementation, which gets
you a fair bit of related-classes functionality.
Anything worth having is worth having two of. Or at least being able to have two
of should the need arise.
.
- Follow-Ups:
- Re: Modules
- From: Frank Adam
- Re: Modules
- From: WebBiz
- Re: Modules
- References:
- Re: Modules
- From: WebBiz
- Re: Modules
- From: Dag Sunde
- Re: Modules
- From: J French
- Re: Modules
- From: Dag Sunde
- Re: Modules
- From: J French
- Re: Modules
- From: Dag Sunde
- Re: Modules
- From: J French
- Re: Modules
- From: Dag Sunde
- Re: Modules
- From: WebBiz
- Re: Modules
- From: J French
- Re: Modules
- From: WebBiz
- Re: Modules
- From: Steve Gerrard
- Re: Modules
- From: WebBiz
- Re: Modules
- From: Frank Adam
- Re: Modules
- From: WebBiz
- Re: Modules
- Prev by Date: Re: Modules
- Next by Date: Re: Modules
- Previous by thread: Re: Modules
- Next by thread: Re: Modules
- Index(es):
Relevant Pages
|