Indirect reference to a group on another card
Posted: Mon Nov 02, 2015 4:28 am
Sorry - but I'm doing my head in trying to work out how to make an indirect reference to a group on another card.
What I have is a card that stores a set of groups that I MIGHT want to use, and an array that identifies which of those groups I actually want to use this time.
Card "AnimalStore" // Contains one group for each animal that I might want to use
Group "Horse"
Group "Fish"
Group "Cow"
Group "Dog"
Group "Cat"
etc
On PreOpenStack
Put "Fish" into WhatAnimalsToUse[1]["AnimalName"]
Put "Dog" into WhatAnimalsToUse[2]["AnimalName"]
Put "Cat" into WhatAnimalsToUse[3]["AnimalName"]
Repeat with X = 1 to 3
// Clone group WhatAnimalsToUse[X]["AnimalName"] of card "AnimalStore"
Set the name of it to "Animal" & X
// Move the cloned group to the card where I want it
End repeat
End PreOpenStack
I've been trying to use the VALUE function to implement the clone statement, but I can't work out how to handle the quotation marks in Card "AnimalStore". I've been trying to solve this with & quote &, but I can't get it right.
What would be the correct syntax for an indirect reference to a group on another card, where the name of the group was stored in an array on this card?
Any help would be much appreciated.
What I have is a card that stores a set of groups that I MIGHT want to use, and an array that identifies which of those groups I actually want to use this time.
Card "AnimalStore" // Contains one group for each animal that I might want to use
Group "Horse"
Group "Fish"
Group "Cow"
Group "Dog"
Group "Cat"
etc
On PreOpenStack
Put "Fish" into WhatAnimalsToUse[1]["AnimalName"]
Put "Dog" into WhatAnimalsToUse[2]["AnimalName"]
Put "Cat" into WhatAnimalsToUse[3]["AnimalName"]
Repeat with X = 1 to 3
// Clone group WhatAnimalsToUse[X]["AnimalName"] of card "AnimalStore"
Set the name of it to "Animal" & X
// Move the cloned group to the card where I want it
End repeat
End PreOpenStack
I've been trying to use the VALUE function to implement the clone statement, but I can't work out how to handle the quotation marks in Card "AnimalStore". I've been trying to solve this with & quote &, but I can't get it right.
What would be the correct syntax for an indirect reference to a group on another card, where the name of the group was stored in an array on this card?
Any help would be much appreciated.