------------------------------------------------------------ HUGO v2.5 - An Interactive Fiction Design System PROGRAMMING MANUAL Copyright (c) 1995-2000 by Kent Tessman (Revised February 2000) ------------------------------------------------------------ ------------------------------------------------------------ The following conventions are used in this manual: for required parameters [parameter] for optional parameters FILE for specific filenames FunctionName functions, etc. 'token' tokens, keywords ... for omissions ------------------------------------------------------------ ------------------------------------------------------------ APPENDIX A: SUMMARY OF KEYWORDS AND COMMANDS *>and DESCRIPTION: Logical and. SYNTAX: x = and RESULT: x will be true if and are both non-zero, false if one or both is zero. *>anything DESCRIPTION: Object specifier in grammar syntax line, indicating that any nameable object in the object tree is valid. *>array DESCRIPTION: When used as a data type modifier, specifies that the following value is to be treated as an array address. EXAMPLE: = array [5] The variable will be treated as an array address. *>break DESCRIPTION: Terminates the immediate enclosing loop. EXAMPLE: while { while { if break ... } ... } The break statement, if encountered, will terminate the innermost loop. *>call DESCRIPTION: Calls a routine indirectly, i.e., when the routine address has been stored in a variable, object property, etc. SYNTAX: call [(, ,...)] or x = call (...) where is a valid data type holding the routine address. VALUE: When used as a function, returns the value returned by the specified routine. *>capital DESCRIPTION: Print statement modifier, indicating that the next word should be printed with the first letter capitalized. SYNTAX: print capital
where
is any dictionary word, such as, for example, an object.name property. *>case DESCRIPTION: Specifies a conditional case in a 'select' structure. SYNTAX: select case [, ,...] ... case [, ,...] ... where is value such as a variable, routine return value, object property, array element, etc., and each is a single value for comparison (not an expression). *>child SYNTAX: x = child() RETURN VALUE: The object number of the immediate child object of , or 0 if has no children. *>children SYNTAX: x = children() RETURN VALUE: The number of child objects possessed by . *>cls DESCRIPTION: Clears the current text window repositions the output coordinates at the bottom left of the text window. SYNTAX: cls *>color *>colour DESCRIPTION: Sets the display colors for text output. SYNTAX: color [, ] where is optional PARAMETERS: Standard color values for and (from HUGOLIB.H) are: 0 Black 1 Blue 2 Green 3 Cyan 4 Red 5 Magenta 6 Brown 7 White 8 Dark gray 9 Light blue 10 Light green 11 Light cyan 12 Light red 13 Light magenta 14 Light yellow 15 Bright white *>dict DESCRIPTION: Dynamically creates a new dictionary entry at runtime. SYNTAX: x = dict(, ) x = dict(parse$, ) where or parse$ holds the string to be written into the dictionary, and represents the maximum number of characters to be written. Returns the new dictionary address. (NOTE: Space should be reserved for any dictionary entries to be created at runtime using the $MAXDICTEXTEND setting during compilation.) *>do DESCRIPTION: Marks the starting point of a do- while loop. SYNTAX: do { ... } while The loop will continue to run as long as holds true. *>elder SYNTAX: x = elder() RETURN VALUE: The object number of the object preceding on the same branch in the object tree. The reverse of 'sibling'. *>eldest Same as 'child'. *>else DESCRIPTION: In an if-elseif-else conditional block, indicates the default operation if no previous condition has been met. SYNTAX: if ... else ... *>elseif DESCRIPTION: In an if-elseif-else conditional block, indicates a condition that will be checked only if no preceding condition has been met. SYNTAX: if ... elseif ... elseif ... *>false DESCRIPTION: A predefined constant value: 0. *>for DESCRIPTION: Loop construction. SYNTAX: for (; ; ) { ... } for in { ... } For the first form, where is the initial assignment expression (e.g. a = 1), is the test expression (e.g. a < 10), and is the modifying expression (e.g. a = a + 1). The loop will execute as long as holds true. The second form loops through all the children of (if any), setting to each child object in sequence. *>held DESCRIPTION: Object specifier in grammar syntax line, indicating that any single object possessed by the player object is valid. *>hex DESCRIPTION: Print statement modifier signifying that the following value is not a dictionary address, but should be printed as a hexadecimal number. SYNTAX: print hex where, for example, is equal to 26, will print "1A". *>if DESCRIPTION: A conditional expression. SYNTAX: if ... where is an expression or value, will run the following statement block only if is true. *>in DESCRIPTION: When used in an object definition, places the object in the object tree as a possession of the specified parent. When used in an expression, returns true if the object is in the specified parent. SYNTAX: in or, for example: if [not] in ... *>input DESCRIPTION: Receive input from keyboard, storing the dictionary addresses of the individual words in the word array. Unrecognized words are given a value of 0. SYNTAX: input *>is DESCRIPTION: Attribute assignment/testing. SYNTAX: is [not] USAGE: When used as an assignment on its own, will set (or clear, if 'not' is used) the specified attribute for the given object. May also be used in an expression. RETURN VALUE: When used in an expression, returns true if has the specified attribute set (or cleared, if 'not' is used). Otherwise, it returns false. *>jump DESCRIPTION: Jumps to a specified label. SYNTAX: jump