> However it's generally a bad idea to mix code and data.
> "G?ran Andersson" <g...@guffa.com> wrote in message
>
[quoted text clipped - 5 lines]
>
> --http://www.markrae.net
Hi,
This is very simple. I have a class with many properties which are of
type collection.
This class also have a function that finds an element in one of those
collections.
The inputs of the function are the name of the property to be used and
the name of the element inside it.
So instead of having a Select Case with many cases I just get one of
the properties using the selected code.
It is working fine. Any problem in using this this way?
Thanks,
Miguel
John Saunders [MVP] - 23 Jun 2007 16:32 GMT
On Jun 23, 11:44 am, "Mark Rae" <m...@markNOSPAMrae.net> wrote:
> "Göran Andersson" <g...@guffa.com> wrote in message
>
[quoted text clipped - 5 lines]
>
> --http://www.markrae.net
Hi,
This is very simple. I have a class with many properties which are of
type collection.
This class also have a function that finds an element in one of those
collections.
The inputs of the function are the name of the property to be used and
the name of the element inside it.
So instead of having a Select Case with many cases I just get one of
the properties using the selected code.
---------
(I don't know why I can't get this message to quote properly!)
If these properties are all the same kind of collection, then perhaps rather
than a class with properties which are collections, you really have a class
with one property which is a collection of collections.

Signature
John Saunders [MVP]
Göran Andersson - 23 Jun 2007 18:52 GMT
>>> However it's generally a bad idea to mix code and data.
>> Absolutely!
[quoted text clipped - 14 lines]
>
> It is working fine. Any problem in using this this way?
If you just want simple, it works.
If you want performance, a switch is your best bet.
If you want robust code, an enum instead of a string as identifier is
better. It also performs slightly better.

Signature
Göran Andersson
_____
http://www.guffa.com