Looking up table values

Hi, all!

Trying to look up a random row in a table and make the text found in that row the value of a variable.


firstname is text that varies.
secondname is text that varies.

carry out giving photostrip to Wilhelm:
	remove photostrip from play;
	choose a random row in the Table of German Names;
	now firstname is the text "[First Name]";
	choose a random row in the Table of German Names;
	now secondname is the text "[Last Name]".


Table of German Names
First Name (text)	Last Name (text)
"Gerhardt"     "Boehm"

Have included only one row of the table. Have tried different permutations of the type of variable (text, etc.) and also ways of phrasing now firstname is…

Most likely there is something about the declaration of variables I am missing or some way of citing table text.

Thank you!

The syntax you’re looking for is

Now firstname is the First Name entry;

This is pretty unclear in the documenation! It first shows up in §16.5 of Writing with Inform, I think, but it’s not exactly explained there.

Full example with a bit added to make it compile and to enable you to give Wilhelm the photostrip:

[code]firstname is text that varies.
secondname is text that varies.

carry out giving photostrip to Wilhelm:
remove photostrip from play;
choose a random row in the Table of German Names;
now firstname is the first name entry;
choose a random row in the Table of German Names;
now secondname is the last name entry.

Table of German Names
First Name (text) Last Name (text)
“Gerhardt” “Boehm”

Lab is a room. Wilhelm is a person in Lab. A photostrip is in Lab. The block giving rule does nothing when the noun is the photostrip.

Every turn: say “Firstname Secondname is [firstname] [secondname].”[/code]

As always, many thanks!