I'm not sure if my eyes are aching and my brain is bleeding, or the other way around. All I know is that I want to put some capsaisin in a bunch of technical writers' Preparation H. :devious:
Anyway, for this question, assume near-complete noobness...
Using VBA in Excel, I want some sort of indexable data structure to hold an indeterminate number of objects, each with a finite list of properties.
Think of a deck of cards - not the standard poker-type, but more like Magic or Fluxx. Each card would have a list of properties such as a unique ID#, title text, effect text, maybe some generic attributes in the 'Attack value/Defense Value/Mana Needed' vein, a flag for if it is currently being used, etc. And the cards would be grouped in to a 'Decks' - say a 'Questions' deck and a separate 'Answer' deck, or 'Monster' deck and 'Weapons' deck. Each deck would have variable number of cards and the ID#s will not necessarily be consecutive, if that matters.
What I want to be able to do is have statements like:
attackroll = *rnd dice roll* + WeaponDeck(playerweapon).AttackValue
where 'playerweapon' would be a integer corresponding to the ID# of a 'weapon card' the player has in his hand
or
for each m in MonsterDeck
if m.MonsterType = "Dragon" then m.UsedInGame = False
next m
where UsedInGame would be a boolean flag to specify if a card will be used in the current ruleset - this example might be removing all the "Dragon" cards from play (but not removing them from the deck) if a player chooses the 'Easy' level.
From what I've been able to decipher, I'm looking for a 'collection'. But, I haven't been able to find any clearly-written description of how to set this up (assuming I'm even on the right path).
HALP!
Anyway, for this question, assume near-complete noobness...
Using VBA in Excel, I want some sort of indexable data structure to hold an indeterminate number of objects, each with a finite list of properties.
Think of a deck of cards - not the standard poker-type, but more like Magic or Fluxx. Each card would have a list of properties such as a unique ID#, title text, effect text, maybe some generic attributes in the 'Attack value/Defense Value/Mana Needed' vein, a flag for if it is currently being used, etc. And the cards would be grouped in to a 'Decks' - say a 'Questions' deck and a separate 'Answer' deck, or 'Monster' deck and 'Weapons' deck. Each deck would have variable number of cards and the ID#s will not necessarily be consecutive, if that matters.
What I want to be able to do is have statements like:
attackroll = *rnd dice roll* + WeaponDeck(playerweapon).AttackValue
where 'playerweapon' would be a integer corresponding to the ID# of a 'weapon card' the player has in his hand
or
for each m in MonsterDeck
if m.MonsterType = "Dragon" then m.UsedInGame = False
next m
where UsedInGame would be a boolean flag to specify if a card will be used in the current ruleset - this example might be removing all the "Dragon" cards from play (but not removing them from the deck) if a player chooses the 'Easy' level.
From what I've been able to decipher, I'm looking for a 'collection'. But, I haven't been able to find any clearly-written description of how to set this up (assuming I'm even on the right path).
HALP!