469,366 Members | 2,243 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

Enumeration vs making a list

To me, when you enumerate, you make a list of specific items, like
enumerating controls in a form. Am I missing something? I mean is there
something more to the meaning of the term "enumeration" or "enumerate" (in
programming context) other than just sounding technical. i.e. is it more
than just making a list of items? Are they the same thing? Please excuse my
'dah' factor, but it is really bugging me.

Willam Roberts

Joy to the world
Jul 17 '05 #1
5 2660
> To me, when you enumerate, you make a list of specific items, like
enumerating controls in a form. Am I missing something? I mean is there
something more to the meaning of the term "enumeration" or "enumerate" (in
programming context) other than just sounding technical. i.e. is it more
than just making a list of items? Are they the same thing? Please excuse my 'dah' factor, but it is really bugging me.


I don't agree with your opening sentence. To me, when you enumerate, you
**take an existing list** and go through it (i.e., count it) one line at a
time; you don't **make** the list. In VB, that definition broadens a little
bit. For example, you can enumerate the controls on a form using code
similar to this

Dim ctrl As Control
For Each ctrl In Controls
If ctrl.Name Like "My*" Then
Debug.Print ctrl.Name
End If
Next

What is happening here is that the For-Each statement is calling up the
controls contained in the Controls collection (which VB maintains
automatically for us), one at a time, looking to print out (in the Immediate
window) all those whose name starts with the letters "My".

Rick - MVP
Jul 17 '05 #2

"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:_c********************@comcast.com...
To me, when you enumerate, you make a list of specific items, like
enumerating controls in a form. Am I missing something? I mean is there
something more to the meaning of the term "enumeration" or "enumerate" (in programming context) other than just sounding technical. i.e. is it more
than just making a list of items? Are they the same thing? Please
excuse my
'dah' factor, but it is really bugging me.
I don't agree with your opening sentence. To me, when you enumerate, you
**take an existing list** and go through it (i.e., count it) one line at a
time; you don't **make** the list. In VB, that definition broadens a

little bit. For example, you can enumerate the controls on a form using code
similar to this

Dim ctrl As Control
For Each ctrl In Controls
If ctrl.Name Like "My*" Then
Debug.Print ctrl.Name
End If
Next

What is happening here is that the For-Each statement is calling up the
controls contained in the Controls collection (which VB maintains
automatically for us), one at a time, looking to print out (in the Immediate window) all those whose name starts with the letters "My".

Rick - MVP


So, enumureating does not mean making a list, rathers its going through one,
that makes sense!
Jul 17 '05 #3
Willam Roberts <Wi*********@hotmail.com> schreef in berichtnieuws
pQ******************@nwrddc02.gnilink.net...

Hello Willam,
To me, when you enumerate, you make a list of specific items, like
enumerating controls in a form. Am I missing something?
No, and yes. "To enumerate" is nothing more than "to count". You don't
*make* a list, you just go thru an allready existing one (Like Rick allready
mentioned).

Ofcourse, sometimes that list is somewhat hidden to the programmer's eye,
and/or you enumerate some list to retrieve some specific data outof it
(which you maybe use to store in a user-viewable form).

For example : think about enumerating entries outof a directory (using
"dir(filemask)" ). The list (directory-entries) is allready there, you just
retrieve them one-by-one, maybe storing (partial) results into a list- or
tree-view.
I mean is there
something more to the meaning of the term "enumeration" or "enumerate" (in
programming context) other than just sounding technical. i.e. is it more
than just making a list of items? Are they the same thing? Please excuse my 'dah' factor, but it is really bugging me.


You're excused. You do *not* want to know the number of questions I did say
"duh !" to when it was explained to me, and thereby the obviousness of it
became clear to me ( the world-famous 20-20 hindsight :-)

Regards,
Rudy Wieser

Jul 17 '05 #4
Thanks Rudy,

I appreciate your thoughts. You and Rick have helped me through one of my
weaknesses, i.e. at times I tend to make things over-complicated when I
strive to understand them.

Kind Regards,

William Roberts

"R.Wieser" <rw***************@xs4all.nl> wrote in message
news:3f***********************@dreader5.news.xs4al l.nl...
Willam Roberts <Wi*********@hotmail.com> schreef in berichtnieuws
pQ******************@nwrddc02.gnilink.net...

Hello Willam,
To me, when you enumerate, you make a list of specific items, like
enumerating controls in a form. Am I missing something?
No, and yes. "To enumerate" is nothing more than "to count". You don't
*make* a list, you just go thru an allready existing one (Like Rick

allready mentioned).

Ofcourse, sometimes that list is somewhat hidden to the programmer's eye,
and/or you enumerate some list to retrieve some specific data outof it
(which you maybe use to store in a user-viewable form).

For example : think about enumerating entries outof a directory (using
"dir(filemask)" ). The list (directory-entries) is allready there, you just retrieve them one-by-one, maybe storing (partial) results into a list- or
tree-view.
I mean is there
something more to the meaning of the term "enumeration" or "enumerate" (in programming context) other than just sounding technical. i.e. is it more
than just making a list of items? Are they the same thing? Please
excuse my
'dah' factor, but it is really bugging me.
You're excused. You do *not* want to know the number of questions I did

say "duh !" to when it was explained to me, and thereby the obviousness of it
became clear to me ( the world-famous 20-20 hindsight :-)

Regards,
Rudy Wieser

Jul 17 '05 #5
Willam Roberts <Wi*********@hotmail.com> schreef in berichtnieuws
l8*******************@nwrddc01.gnilink.net...

Hello William,
Thanks Rudy,

I appreciate your thoughts. You and Rick have helped me through one of my
weaknesses, i.e. at times I tend to make things over-complicated when I
strive to understand them.


You're welcome :-)

Regards,
Rudy Wieser

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Antoine Junod | last post: by
7 posts views Thread by Nathan | last post: by
2 posts views Thread by Charlie | last post: by
6 posts views Thread by Jan Sneeuwman | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.