Trying to pass parameters in Inform7

Hello, I’m trying implement an old-school command ANALYZE something, which lets a player undertake further analysis (eg. fingerprints, chemical analysis) with a time delay. This is similar to what Infocom does in Deadline by having Sgt Duffy go off to the lab to analyze something at the player’s request. But I have encountered some Inform7 syntax challenges when trying to pass parameters and have a delay. I have a static table of objects with the corresponding results of Sgt Duffy findings. Conceptually what I’m trying to do is:

[code][pseudo code]
analyze(prop)
if prop is in the table of analysis
say “Duffy enthusiastically takes the item to analyze.”
call analysis completed (prop) in four turns;
else
say “Duffy skeptically takes the item to analyze.”
call analysis completed (prop) in four turns.

analysis completed (prop)
if prop is in the table
say “Duffy reports on the [prop] and says [result corresponding to prop in table]”.
[/code]
However, it hasn’t worked out as I hoped! Any ideas here are welcome. I’ve put a minimal code example below but it gets lots of compiler errors. I’m sure this is something boneheaded, but I’m not seeing and need to get on a plane in a couple of hours.

"Parameter passing" by Zack

Section - Analyze Command

[ Provides the player the ability to ANALYZE different items and find more clues, such as fingerprints, chemical analysis etc.  ]

The player is in the Hotel Room. 

Hotel Room is a room.  "You're at the San Moreno Inn, room 108.  You've got a desk, a dresser, a nightstand.  You've stayed in plenty of worse dives.  The bathroom is to the east."

Gun has description "It's a gun."
Brown wallet has description "It's a brown wallet."
Matchbook has description "It's a matchbook."

Gun, brown wallet, matchbook are in the hotel room.

Analyzing is an action applying to one thing. Understand "analyze [something]" as analyzing.

carry out analyzing something (called the prop): 
	say "Sgt Duffy steps silently by your side.  [run paragraph on]";
	if there is a item of prop in the Table of Analysis:
		let result be the results corresponding to an item of prop in Table of Analysis;
		let clue be the clues corresponding to an item of prop in Table of Analysis;
		say "Duffy nods energetically.  'I'll have the boys in the lab analyze [prop] and see what they can find.'  Sgt Duffy walks out of your view.";
		[ the following line gives an error on four turns from now ]
		Have analysis of prop done [in four turns from now];
	else:   
		say "Duffy looks at you skeptically.  'You want me to analyze [prop]?  Ok, I'm on it.'  Sgt Duffy shuffles out of your sight dejectedly."

[ how do you pass parameters and have the actions be delayed?]	
To Have Analysis of (a prop - a thing) done:
	if there is a item of prop in the Table of Analysis:  [ gives an error]
		[the following line gives an error]
		let result be the results corresponding to an item of prop in Table of Analysis;
		say "'We've analayzed [prop].  [result]'[line break]".

[ This table provides results from Duffy's analysis of objects.  
  The note field is used for "try noting ..."  to trigger a possibly new clue. 
  These clues have not been added yet and the note words not verified]


Table of Analysis
item	clues	results
gun	"gun"	"It's your lucky day.  They found your fingerprints all over it."
brown wallet	"brown wallet"	"What a surprise --it's got your fingerprints all over it."
matchbook	"matchbook"	"It's got Tony's fingerprints on it as well as Monica Robner's."

In the “X in Y turns from now” phrase, X has to be a rule, not a phrase (section 9.11 in the docs). I’m not certain if it has to be an “At the time when” rule, but all the examples show that. There is no way of passing a parameter - use a global.

(Also, you shouldn’t print anything during carry out - that’s for the report stage - and the failure case should be a check rule.)

The currently analyzed item is a thing that varies.
Check analyzing something (called the prop):
   if there is no item of prop in the Table of Analysis, instead say "Duffy looks at you skeptically.  'You want me to analyze [prop]?  Ok, I'm on it.'  Sgt Duffy shuffles out of your sight dejectedly."
Carry out analyzing something (called the prop): 
    now the currently analyzed item is the prop;
    the analysis is complete in four turns from now;
Report analyzing something (called the prop):
    say "Duffy nods energetically.  'I'll have the boys in the lab analyze [prop] and see what they can find.'  Sgt Duffy walks out of your view.";

At the time when the analysis is complete:
    choose the row with item of the currently analyzed item in the Table of Analysis;
    say "'We've analyzed [the currently analyzed item]. [results entry]'[line break]".

Note that it’s not possible to have more than one thing analyzed at a time - Inform 7 can only queue up one future occurrence of a particular event. There’s an extension called Scheduled Activities by John Clemens that can handle multiple occurrences (and allow the event to take a variable).

Thanks, looks great. I thought I might need to resort to another global variable. I’ll see if I can get this going on my flight. I will be adding a busy status for Sgt Duffy so he can only analyze one thing at a time.
–zack