Continuing my training on tables, I have a new quandary.
The short version: Targeting a table, is there a way to identify ALL rows sharing a certain value, and then blank out only those rows?
The long version:
I have a few playable characters who come and go. Each character has a few special skills. I have a table listing the verbs available to the player and update that table depending on who they are at that moment.
The table:
Table of Game Verbs
Action Character
"Examine" 0
"Look" 0
"Take" 0
"Ask about" 0
"Drink" 0
"Use" 0
"Fill" 0
"Give" 0
with ten blank rows
Basic verbs are given a “character” of zero. Each character has their own “character” value. When one of those characters are selected, their rows of character-specific verbs are added.
Let’s say we’ve selected one of the characters and then table then looks like this:
Table of Game Verbs
Action Character
"Examine" 0
"Look" 0
"Take" 0
"Ask about" 0
"Drink" 0
"Use" 0
"Fill" 0
"Give" 0
"Repair" 1
"Shoot" 1
We then want to choose a different character, necessitating the removal of those two rows. Is there a way to identify ALL rows sharing a certain value, and then blank out those rows?
Since the basic verb list is fixed, I can see a mightily inefficient way of doing some thing like this:
repeat through the Table of Game Verbs:
choose row 9 in Table of Game Verbs;
blank out the whole row;
choose row 10 in Table of Game Verbs;
blank out the whole row.
Etc.
I guess there’s nothing entirely wrong with that but I’m hoping I’m just in need of a syntax lesson and it turns out to be something like the below (but wouldn’t also cause a run-time error):
repeat through the Table of Game Verbs:
choose a row with a character value >0 in Table of Game Verbs;
blank out the whole row.
Thank you.