The TADS Alternate Library
Version 2.0

Global Command Variable Functions

Copyright 2000 by Kevin Forchione.
This is part of the TADS Alternate Library Authors Manual.

Introduction and Table of Contents

Global Command Variable Functions


Alt provides several global command functions. These functions can provide information concerning a specific global command variable to functions and methods similarly to the TADS built-in parserGetObj() function. The functions and the variables returned are:



global variable


Returns the string of words that form the player command for this turn of command execution.


Returns the actor object


Returns the verb object


Returns the multiple direct-object list that gets passed to preCommand() and endCommand() or an empty list


Returns the current direct-object as supplied by the parser for command execution or nil


Returns the preposition object or nil


Returns the indirect-object or nil


Returns the actor’s scope ceiling.


Returns the status of command as established by the author (by setting it manually) or by the parser corresponding to one of the EC status codes


Global command variables can be set simply by passing the desired value as the parameter of the function. For instance to set the global variable for the direct object you would pass the value as follows:




where myDobj is either nil or an object. Alt automatically sets global variables at preCommand(), verb.verbAction(), postAction(), and endCommand().




The exception to this is gLocation(), which cannot be set. The gLocation() function only returns a value. You can pass a sense object to the function, which will return the scope ceiling for the actor for that particular sense. For example, gLocation(sound) will return the actor’s scope ceiling for hearing objects.