|
-
Mar 27th, 2010, 04:45 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Simple example of creating an Enumerable
I think I understand from a previous post that an Enumerable is that allows me to do stuff like:
MyFunction("somestring", MyEnum.MeaningfulName)
Where the function does something, and the MyEnum contains a series of numeric designators assigned to meaningful names. The function then decides what to do based on those meaningful names.
I'd like to to create my own Enumerable (MyEnum) with my own series of designations. But I can't find a simple example of how to do this online. Everything I find is overcomplicated and blown out of proportion so badly that I can't begin to decipher from all the noise how I'd go about just doing what I want--which is really basic.
I just need to know the basic syntax involved in defining an enumerable. I already know how to use it once it's defined.
In an effort to abolish the writing of "Spaghetti Code",
some fools got together and invented Spaghetti Syntax.
-
Mar 27th, 2010, 04:51 AM
#2
Thread Starter
Hyperactive Member
Re: [RESOLVED] Simple example of creating an Enumerable
Never mind! I got it. What I couldn't find on the net I found in one of my useless books. Amazing!
In an effort to abolish the writing of "Spaghetti Code",
some fools got together and invented Spaghetti Syntax.
-
Mar 27th, 2010, 06:18 AM
#3
Re: [RESOLVED] Simple example of creating an Enumerable
That's an "enumeration", not an "enumerable". If you're talking about the thread that I think you are then that was explained more than once. An enumerable is something that implements the IEnumerable interface and can therefore be looped over using a For Each loop. Maybe you're not talking about the thread I thought you were because it also shows how to declare an enumeration. Actually no, it looks like you were talking about that thread because you posted to it. Maybe you should have read it more carefully.
http://www.vbforums.com/showthread.p...ht=enumeration
Post #3 explains what an enumeration is and how to declare one, as does at least one other post later on, which I know because I posted it.
-
Mar 27th, 2010, 06:22 AM
#4
Thread Starter
Hyperactive Member
Re: [RESOLVED] Simple example of creating an Enumerable
 Originally Posted by jmcilhinney
That's an "enumeration", not an "enumerable". If you're talking about the thread that I think you are then that was explained more than once. An enumerable is something that implements the IEnumerable interface and can therefore be looped over using a For Each loop. Maybe you're not talking about the thread I thought you were because it also shows how to declare an enumeration. Actually no, it looks like you were talking about that thread because you posted to it. Maybe you should have read it more carefully.
http://www.vbforums.com/showthread.p...ht=enumeration
Post #3 explains what an enumeration is and how to declare one, as does at least one other post later on, which I know because I posted it.
I should have reread that post. Anyway, what I'm using is declared as "Enum". It's pretty interesting. I really like this particular structure. It's uses are endless.
In an effort to abolish the writing of "Spaghetti Code",
some fools got together and invented Spaghetti Syntax.
-
Mar 27th, 2010, 06:48 AM
#5
Re: [RESOLVED] Simple example of creating an Enumerable
They are pretty handy little b*ggers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|