growedup
asked on
assign properties to array elements
What is the best approach for creating my own properties to items in an array?
For example, I will have an array of places. The Array will be populated by a list created by the user on an excel worksheet. I would like each place to have properties, such as name, etc., etc. Some properties will be assigned through the list the user created, others will be assigned from external data (Web Query).
I'm thinking (after being setup properly) assigning a value to the property would look something like this: place(i).name = "Hell".
Any insight is appreciated, thanks.
For example, I will have an array of places. The Array will be populated by a list created by the user on an excel worksheet. I would like each place to have properties, such as name, etc., etc. Some properties will be assigned through the list the user created, others will be assigned from external data (Web Query).
I'm thinking (after being setup properly) assigning a value to the property would look something like this: place(i).name = "Hell".
Any insight is appreciated, thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Places(i,properties(x)) is not in the ccoorect syntax
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For this project, declaring a type is the best solution. Using a dictionary is a great solution as well, but is too complex for this project. I will definately be considering it for future projects though.
ASKER
Thanks for all the fast inputs everyone!
properteis[0] = "hell" ' Name
properteis[1] = .. ' other property
...
Places(i,properties(x))