Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Nov 30, 2003 12:48 pm |
You have three options: 1) create a third list that contains the one word reminders in order for each item in the master list, 2) convert the master list into a record variable where the keys are the MUD messages and the values are the one word reminders, or 3) just use the MUD message already stored into the master list as the echo instead of a separate one word reminder.
Number two gets complicated a bit because the keys would contain more than one word. I believe you already have the general idea of how to do number three:
#FORALL @masterList {#IF (!%ismember("%i", @currentList)) {#SAY %i}}
which is to iterate through each item in the master list (using #FORALL) and find out if each one is also in the current list. If one is not in the current list, just output the current item of the master list that we are considering (%i).
The first option is similar to the third, except that you need to consult another list to find out the message:
#FORALL @masterList {#IF (!%ismember("%i", @currentList)) {#SAY %item(@reminderList, %ismember(%i, @masterList))}}
The trick here is that, since #FORALL gives you access to the actual item in the list that is being considered, not its position, we need to find out its position in the list. For that, we use %ismember which will also return the items position in the list if it is found. Assuming that @reminderList has all the one word reminders corresponding to each item in @masterList in the corrrect order, then we just need to pass this value to %item to get the correct message to output.
I'll let you find out how to implement the second option. For that, you should look into record variables, #LOOPDB, and %db. |
|