Ntherrington
New Member
- Joined
- Apr 27, 2014
- Messages
- 1
I have created a class to record the properties of a foreign currency trade (date, amount, buy/sell, rate, currency. A new instance must be created for each unique rate. I have figured out the if thens to establish when to create a new instance but I have been unable to figure out how to create a automated naming of instances:
for example
EUR1.rate = x
EUR2.rate = y
EUR3.rate = z
but I don't think I can use numbers because I can never know if I will have 0 or 1,000 rates.
i tried using EUR(Z)
'logic
Z = Z + 1
This errors and won't run. Is it possible to put a variable in a variable name or is there a good work around?
for example
EUR1.rate = x
EUR2.rate = y
EUR3.rate = z
but I don't think I can use numbers because I can never know if I will have 0 or 1,000 rates.
i tried using EUR(Z)
'logic
Z = Z + 1
This errors and won't run. Is it possible to put a variable in a variable name or is there a good work around?