PDA

View Full Version : Indexing of custom - type properties



dcherk1
10-26-2007, 10:19 PM
I have a big custom type variable with multiple fields of different types. Is it possible to somehow refer to these fields using an index number instead of typing the name of each field separately?

By the way, I am a complete novice, so if you have an equivalent of a sandbox in this forum feel free to direct me there

Bob Phillips
10-27-2007, 02:05 AM
No, that is the way that types work. It makes for documentiung code, and you usually don't type it all that often.

matthewspatrick
10-27-2007, 06:02 AM
Bob is right about user defined types.

One alternative would be to use a Collection object to store your custom
properties; you could then retrieve members of the collection using either
the numeric index or the string key.

Not saying that I like this approach, but it is an alternative. For myself,
I'd be more inclined to start looking at classes...

Bob Phillips
10-27-2007, 07:13 AM
Me too, a totally flexible user defined type. Not as quick to setup, but immeasurably more useful, and less crippled.

dcherk1
10-27-2007, 08:03 AM
Thank you for your answers!

I guess I haven't gotten to that chapter yet.