If somebody could point me in the right direction, I am trying to compare two different texts that have been inputted.
First, the randomly generated text of the name on an ID:
[code]
firstname is text that varies.
secondname is text that varies.
carry out giving photostrip to man:
remove photostrip from play;
choose a random row in the Table of Names;
now firstname is the First Name entry;
choose a random row in the Table of Names;
now secondname is the Last Name entry.
[\code]
Later on, the player requests that a check be written to someone of a specified name that the player types in (obviously, I have defined the checknaming action separately):
[code]
checkcasher is some text that varies.
carry out checknaming:
now checkcasher is the topic understood;
say “[line break]Check recipient: [checkcasher]”.
[\code]
The player, then needs to pick the check up at the bank. If the ID doesn’t match the name on the check, the teller should not dispense the check:
[code]
check giving id to teller:
if checkcasher is “[firstname] [lastname]”:
continue the action;
otherwise:
say “The cashier frowns. ‘I’m sorry, sir,’ the cashier says and hands the ID back to you. ‘Your name doesn’t match the one on the check.’” instead.
[\code]
If someone could point me in the direction of how to compare texts in this fashion, I’d appreciate it. I have also tried:
[code]
check giving id to teller:
if checkcasher matches “[firstname] [lastname]”:
continue the action;
otherwise:
say “The cashier frowns. ‘I’m sorry, sir,’ the cashier says and hands the ID back to you. ‘Your name doesn’t match the one on the check.’” instead.
[\code]
Thank you!