This file is part of the TADS Author's Manual.
Copyright © 1987, 1996 by Michael J. Roberts. All rights reserved.

The manual was converted to HTML by N. K. Guy, tela design.


Appendix E


Errors

This chapter describes how the compiler and run-time system handle errors. A list of errors is provided.


Errors and Error Recovery

When the TADS Compiler detects a syntax or other error in your source file, it attempts to skip ahead to the end of the offending program section. Unfortunately, because the program has a problem, TADS sometimes becomes confused and issues several spurious error messages that are all really due to the original error.

When compiling code, such as inside a method, TADS will try to skip the statement that caused the error; it simply looks for the semicolon that ends the statement. This strategy is most likely to backfire when the error was due to a missing semicolon in the first place.

When compiling an object definition outside of code, TADS will skip the entire object that caused the error. Again, it skips ahead to the next semicolon. If program code intervenes, this often results in more errors; these errors are generally of the form "Expected object or function definition." You can normally ignore such errors when several of them occur consecutively, and look only at the first error which started the trouble, since the subsequent errors may be part of the compiler's attempts to recover from the original error. Once an object or function definition does show up, TADS will normally stop complaining.


Classes of Errors

TADS has four classes of errors. TADS recovers from errors based on their class.

A fatal error is one from which the compiler is totally unable to recover; these are generally due to missing files or lack of memory. TADS cannot continue operating after a fatal error, so it terminates.

A compile-time error results when the compiler detects a problem with your source code, such as a syntax error, or an undefined symbol. TADS attempts to recover from these errors by skipping the section of code that had the error. When a compile-time error is found in your source code, even though the compiler will continue to process your game, you won't be able to run the game until you have fixed the error.

A warning is generated when the compiler detects a questionable construct and wishes to bring it to your attention. Warnings do not otherwise affect compilation; they are produced purely for your information. You should carefully check each warning message to ensure that it's not justified before choosing to ignore it.

A run-time error is produced when your program, while it's running, does something illegal, such as adding two objects together; these errors cannot be detected during compilation, because they depend on the state of your program as it runs. If you have compiled your program with source-level debugging information, TADS will automatically produce a symbolic trace showing the function or method that was executing when the error occurred, as well as the function or method that called it, and so forth. When debugging information is not present, TADS will only be able to show the error message, and won't be able to provide any information on where it occurred. After a run-time error has occurred, TADS will attempt to continue executing your game by dropping what it was doing when the error occurred and returning to the player command line.


Error Listing

This section lists the errors that TADS generates. In addition, we explain the conditions that give rise to the errors, and what steps to take to fix them.

To make it easier for you to find information on an error in this book, all TADS errors and warning messages are numbered. When TADS displays an error, it will preface the message with a code such as "TADS-382"; you can use the number in this error code to find the description of the error in the numerically sorted listing in this section.

TADS-1: out of memory

The program has run out of memory. Even though TADS uses a virtual memory subsystem that allows your game to exceed available memory by swapping portions of memory to a disk file, TADS allocates a certain amount of memory that cannot be swapped to disk. As TADS executes, it extends the size of the virtual object cache, and also allocates fixed (unswapped) memory. It is possible for the cache to grow so large that additional fixed memory cannot be allocated; when this happens, TADS runs out of memory and can't continue. When this error occurs, the TADS compiler will display a message indicating the size of the virtual object cache; you should re-run the compiler with a smaller setting for the -m (cache size limit) option. See appendix C of this manual for details.

TADS-2: error seeking in file

An operating system error occurred seeking in a file. This usually indicates an internal problem with TADS.

TADS-3: error reading from file

An operating system error occurred reading from a file. This usually indicates an internal problem with TADS.

TADS-4: no more page slots

The virtual memory subsystem does not have any more space for allocating internal tables to track virtual memory objects. The internal limits are high enough that this error should never occur.

TADS-5: attempting to reallocate a locked object

This error indicates an internal problem with TADS.

TADS-6: swapfile limit reached - out of virtual memory

The limit you specified with the -ts option for the size of the swap file has been reached. You should raise or remove this limit.

TADS-7: error writing file

An operating system error has occurred writing a file. This usually indicates that the disk is full. You should try to make more space available by deleting files if possible, or by using another disk with more space available.

TADS-8: exceeded swap page table limit

The compiler has reached its internal limit for memory to track objects swapped out to disk. This limit is high enough that this error should never occur.

TADS-9: requested client object number already in use

This error indicates an internal problem with TADS.

TADS-10: client mapping table is full

The compiler has reached an internal limit. This limit is high enough that this error should never occur.

TADS-11: no memory, even after swapping/garbage collection

The virtual object cache is full or too fragmented to allocate needed memory. The most likely problem is that the cache is too small; increasing the size of the cache (specified with the -m compiler and run-time options) should alleviate this problem.

TADS-12: no memory to resize (expand) an object

The virtual object cache is full. See error 11 above.

TADS-13: unable to open swap file

The swap file cannot be created. This could mean that the filename is invalid, or the indicated device (volume) or directory does not exist, or that the disk is full or write-protected.

TADS-14: can't get a new object header

The virtual memory subsystem has run out of memory. See error 11 above.

TADS-15: mcm cannot find object to load (internal error)

This error indicates an internal problem with TADS.

TADS-16: attempting to free a locked object (internal error)

This error indicates an internal problem with TADS.

TADS-100: invalid token

Your source file contains a character that TADS does not recognize.

TADS-101: end of file while scanning string

Your source file ends within a quoted string. This usually indicates that you left out the closing quote of a string somewhere in the file.

TADS-102: symbol too long - truncated to "xxx"

The indicated symbol is too long. Processing can continue, but TADS will only pay attention to the truncated version.

TADS-103: no space in local symbol table

The local symbol table is full. You can increase the amount of space available for local symbols with the -ml compiler option; see appendix C.

TADS-104: invalid preprocessor (#) directive

You have specified an invalid preprocessor directive. When a pound sign (#) occurs in the first column of your source file, the compiler expects a valid preprocessing directive (such as include) to follow.

TADS-105: no filename in #include directive

You have specified a #include directive with no filename. The filename must occur on the same line as the #include directive, and must be enclosed in double quotes or angle brackets.

TADS-106: invalid #include syntax

The #include directive must be followed on the same line by a filename enclosed in double quotes or angle brackets.

TADS-107: can't find included file "xxx"

The compiler could not open the specified include file. Check to make sure that the file is in one of the directories specified with the -i compiler options (see appendix C).

TADS-108: no matching delimiter in #include filename

The filename of a #include directive was not properly terminated with a double quote or right angle bracket.

TADS-109: out of space for symbol table expansion

The symbol table is too large. Since the symbol table is stored in the virtual object cache, this generally indicates that the compiler is out of cache memory.

TADS-110: input line is too long

Your input file contains a line that is too long. The compiler can handle extremely long lines (up to about 16,000 characters). Break the long line into two or more lines.

TADS-111: warning: file "xxx" already included; #include ignored

The specified file has already been included and will not be included again. This warning is most often issued when using pre-compiled header files (see appendix C), and is almost always harmless.

TADS-200: operation is too big for undo log

A single run-time operation has exceeded the size of the undo log. The undo log will be discarded, since it can no longer be used to roll back game state.

TADS-201: no more undo information

No more undo information is available in the undo log. This means that you have applied all undo information, and cannot undo any more turns.

TADS-202: incomplete undo (no previous savepoint)

While attempting to roll back to a savepoint, the undo log ran out of information. This means that a turn may be partially undone.

TADS-300: expected token

The compiler requires the specified token. Insert the required token.

TADS-301: expected a symbol

The compiler requires a symbol in this context, and found something else.

TADS-302: expected a property name

The compiler requires a property name in this context, and found something else.

TADS-303: expected an operand

The compiler requires an operand in an expression, and found something else.

TADS-304: expected a comma or closing paren (in arg list)

Your program has a syntax error in an argument list; variables must be separated by commas, and the argument list must be terminated with a right parenthesis.

TADS-305: no space for new parse node

The compiler is out of space parsing an expression. This can sometimes happen with very long strings, especially those that contain embedded expressions. Use the compiler's -mp switch to increase the amount of space available for expression parsing.

TADS-306: expected object name

The compiler requires an object name in this context.

TADS-307: redefining symbol as external function

You have declared a symbol as an external function when it already has been declared as another type.

TADS-308: redefining symbol as function

You have declared a symbol as a function when it already has been declared as another type.

TADS-309: can't use "class" with function/external function

You have specified the class keyword in a function or external function declaration, which is not allowed (because it makes no sense).

TADS-310: unary operator required

Your expression requires a unary operator (that is, an operator which takes a single operand, such as - or not).

TADS-311: binary operator required

Your expression requires a binary operator (that is, an operator which takes two operands, such as * or and).

TADS-312: invalid binary operator

You have specified an invalid binary operator.

TADS-313: invalid assignment

You have used an invalid expression on the left hand side of an assignment operator (:=). You can only assign values to local variables, properties, and list elements. It is invalid, for example, to assign a value to an expression such as (1+1).

TADS-314: variable name required

The compiler requires a variable name in this context.

TADS-315: comma or semicolon required in local list

Variables declared in a local statement must be separated by commas, and the list must be terminated by a semicolon.

TADS-316: right brace required (eof before end of group)

Your source file is missing the right brace to close a statement block.

TADS-317: `break' without `while'

The break statement can only occur within a while, for, do, or case statement. Your source file contains a break statement that is not associated with one of these statements.

TADS-318: `continue' without `while'

The continue statement can only occur within a while, for, or do statement.

TADS-319: `else' without `if'

Your source file contains an else that is not associated with an if statement. Note that TADS version 1 ignored a semicolon between a closing brace and an else keyword; in version 2, the semicolon is considered a null statement which terminates the if statement. If your program compiled correctly with TADS version 1 but encounters error 319 with TADS version 2, you should specify the -1e compiler option, which will cause the compiler to adopt the behavior of version 1 with respect to this construct. See appendix C for details.

TADS-320: warning: possible use of `=' where `:=' intended

The compiler has detected a statement which it suspects is an assignment that has been accidentally miscoded with "=" (which is the relational equality comparison operator) instead of ":=" (the assignment operator). The compiler is almost always right in these situations; you should check the statement to ensure that you coded what you really meant.

TADS-321: unexpected end of file

The compiler has encountered the end of your source file when it thought it had more work to do. This could mean that you have left off the semicolon terminating an object definition, or a right brace terminating a function.

TADS-322: general syntax error

The compiler has detected an ill-formed statement.

TADS-323: invalid operand type

One of the operands in an expression is not suitable for the operator. This usually means that a constant in the expression is of the wrong type.

TADS-324: can't expand local symbol table

The compiler cannot allocate space for a new local symbol table. You should specify a larger value with the compiler's -ml option (see appendix C).

TADS-325: can't expand argument symbol table

The compiler cannot allocate space for a new argument symbol table. You should specify a larger value with the compiler's -ml option (see appendix C).

TADS-326: redefining a function which is already defined

You are attempting to define a function twice.

TADS-327: `case' or `default' not in switch block

You have coded a case or default label outside of a switch statement.

TADS-328: constant required in switch case value

The values in case labels must be constants. You have specified a non-constant expression as a case label.

TADS-329: label required for `goto'

You have omitted the label of a goto statement, or the symbol specified is something other than a label.

TADS-330: `goto' label never defined

A label used in a goto statement is not defined within the function or method in which the goto statement occurred. The goto statement can only be used with labels within the same function or method as the goto statement itself.

TADS-331: too many superclasses for object

You have specified too many superclasses in an object definition.

TADS-332: redefining symbol as object

You are attempting to define a symbol as an object, but you have already defined the symbol as something else.

TADS-333: property being redefined in object

You are attempting to define a symbol as an object, but the symbol has already been used as a property.

TADS-334: invalid property value

The value specified for a property's initial value in an object definition is not valid.

TADS-335: invalid vocabulary property value

The value specified for a vocabulary property is invalid. You can only use single-quoted strings for vocabulary properties.

TADS-336: invalid template property value (need string)

The value specified for a template is invalid. You can only use a single-quoted string for a template property.

TADS-337: template base property name too long

The base name of a template property value is too long. Since these values must be appended to the strings do, verDo, io, and verIo, the resulting symbols will be up to five characters longer than the property value itself.

TADS-338: too many templates (internal compiler limit)

You have defined an object with too many templates.

TADS-339: invalid value for compound word (string required)

You have specified something other than a single-quoted string in a compoundWord definition.

TADS-340: invalid value for format string (string required)

You have specified something other than a single-quoted string in a formatString definition.

TADS-341: invalid value for synonym (string required)

You have specified something other than a single-quoted string in a synonym definition.

TADS-342: undefined symbol

You have referenced a symbol which has not been defined.

TADS-343: invalid value for specialWords list (string required)

You have specified something other than a single-quoted string in a specialWords list.

TADS-400: object cannot grow any bigger - code too big

The object is too large. This is unlikely to occur, since the limit on the size of an object is very high; however, if it does, you can break the object up into two or more objects, with the first object inheriting from the second.

TADS-401: no more temporary labels/fixups (internal compiler limit)

The compiler has run out of space during code generation. You should reduce the complexity of your code (for example, reduce the nesting of loops and conditional statements).

TADS-402: (internal error) label never set

This error indicates an internal problem with TADS.

TADS-403: invalid datatype for list element

A list element is of an invalid type.

TADS-404: too many debugger source line records (internal limit)

Your source program has generated too many debugger source line records. This is an internal TADS limit; the limit is high enough that this error should never occur.

TADS-450: vocabulary being redefined for object

You have defined a vocabulary word more than once for a particular object.

TADS-500: location of object "xxx" is not an object

This is a warning. In most cases, you want an object's location property to refer directly to another object, since this allows the compiler to generate a matching contents property automatically. Under certain conditions, you may intentionally use a method for a location value. When you have intentionally coded something other than an object for a location value, you can add the property locationOK = true to the object, which will suppress this warning message.

TADS-501: contents of object "xxx" is not list

You should almost never code a contents property for an object, since the compiler automatically sets up these properties.

TADS-502: overflow trying to build contents list

A contents property list has grown too long. This is an internal limit; move some of the contents of the object somewhere else.

TADS-503: required object "xxx" not found

The specified object has not been defined in your game, but the TADS compiler requires you to define it.

TADS-504: warning - object "xxx" not found

The specified object has not been defined by your game. This is not an error, because the object is not required by TADS; however, TADS generates this warning in case you thought you had declared this object.

TADS-505: too many built-in functions (internal error)

This indicates an internal problem with TADS.

TADS-600: unable to open game for writing

The game binary file could not be created. This could mean that the name is invalid, or the device (volume) or directory is invalid or does not exist, or that the disk is full or write-protected.

TADS-601: error writing to game file

An operating system error occurred writing to the game file. This usually means that the disk is full.

TADS-602: too many sc's for writing in fiowrt

This indicates an internal problem with TADS.

TADS-603: undefined function "xxx"

The specified function was called or declared, but never defined.

TADS-604: undefined object "xxx"

The specified object was referenced, but never defined.

TADS-605: undefined symbols found

One or more undefined symbols was found in your program.

TADS-606: unable to open game for reading

The game binary file couldn't be opened. This could mean that the file does not exist, or that the filename is invalid, or that the device (volume) or directory is invalid or does not exist.

TADS-607: error reading game file

An operating system error has occurred reading the game file. This could mean that the file has been corrupted.

TADS-608: file has invalid header - not a TADS game file

The specified binary game file is not a TADS game file. This could mean that you have specified the incorrect file, or that the file has become corrupted.

TADS-609: unknown resource type in .gam file

The game file contains invalid data. This could mean that the file has become corrupted.

TADS-610: unknown object type in OBJ resource

The game file contains invalid data. This could mean that the file has become corrupted.

TADS-611: file saved by different (incompatible) version

The game file or save file was created by an incompatible version of TADS or of the game. You should either use the version of the TADS run-time that matches the version used to compile the game, or you should recompile the game with a compiler that matches your run-time.

TADS-612: error loading object on demand

An object could not be loaded. This could mean that the game file is corrupted, or that the disk file has become unavailable (for example, you have removed the floppy on which the game file was stored from the disk drive).

TADS-613: object too big for load region (internal error)

This indicates an internal problem with TADS.

TADS-614: did not expect external function

This indicates an internal problem with TADS.

TADS-990: user requested cancel of current operation

You have cancelled compilation of your game, such as by hitting the "cancel" button on the Macintosh compiler.

TADS-1001: stack overflow

Run-time stack space has been exceeded. This usually means that your program has gone into infinite recursion - that is, a function is calling itself repeatedly. If the program appears to be behaving correctly, you can increase the size of the run-time stack with the -ms run-time parameter (see appendix D).

TADS-1002: heap overflow

Run-time heap space has been exceeded. You can increase the size of the run-time heap with the -mh option (see appendix D).

TADS-1003: numeric value required

A run-time operation that requires a numeric value was invoked with some other type of value.

TADS-1004: stack underflow

Too many elements have been removed from the run-time stack. This usually indicates that you have called a function with an invalid number of arguments.

TADS-1005: logical value required

A run-time operation that requires a logical value true or nil was invoked with some other type of value.

TADS-1006: invalid datatypes for magnitude comparison

A magnitude comparision operator (>, <, >=, or <=) was called with something other than a number or string.

TADS-1007: string value required

A run-time operation that requires a string value was invoked with some other type of value.

TADS-1008: invalid datatypes for binary `+' operator

The binary "+" operator works only on strings, lists, and numbers.

TADS-1009: invalid datatypes for binary `-' operator

The binary "-" operator works only on lists and numbers.

TADS-1010: object value required

A run-time operation that requires an object value was invoked with some other type of value.

TADS-1011: function pointer required

A run-time operation that requires a function pointer value was invoked with some other type of value.

TADS-1012: property pointer value required

A run-time operation that requires a property pointer value was invoked with some other type of value.

TADS-1013: `exit' statement executed

If this error occurs, it indicates an internal problem with TADS.

TADS-1014: `abort' statement executed

If this error occurs, it indicates an internal problem with TADS.

TADS-1015: `askdo' statement executed

If this error occurs, it indicates an internal problem with TADS.

TADS-1016: `askio' executed; preposition is object #n

If this error occurs, it indicates an internal problem with TADS.

TADS-1017: `quit' executed

If this error occurs, it indicates an internal problem with TADS.

TADS-1018: `reset' executed

If this error occurs, it indicates an internal problem with TADS.

TADS-1020: list value required

A run-time operation that requires a list value was invoked with some other type of value.

TADS-1021: index value too low (must be >= 1)

The value of a list index operation was below 1.

TADS-1022: index value too high (must be <= length(list))

The value of a list index operation was higher than the number of elements in the list.

TADS-1023: invalid type for built-in function

Your program called a built-in function with the incorrect type of arguments.

TADS-1024: invalid value for built-in function "xxx"

Your program called a built-in function with the incorrect type of arguments.

TADS-1025: wrong number of arguments to built-in

Your program called a built-in function with the incorrect number of arguments.

TADS-1026: wrong number of arguments to user function

Your program called one of its own functions or methods with the incorrect number of arguments.

TADS-1027: string/list not allowed for fuse/daemon arg

The parameter to a fuse or daemon (specified in a setdaemon() or setfuse() call) cannot be a string or a list.

TADS-1028: internal error in setfuse/setdaemon/notify

This indicates an internal problem with TADS.

TADS-1029: too many fuses

You have attempted to register too many fuses simultaneously.

TADS-1030: too many daemons

You have attempted to register too many daemons simultaneously.

TADS-1031: too many notifiers

You have attempted to register too many notifiers simultaneously.

TADS-1032: fuse not found in remfuse

You have tried to remove a fuse that is not active.

TADS-1033: daemon not found in remdaemon

You have tried to remove a daemon that is not active.

TADS-1034: notifier not found in unnotify

You have tried to remove a notifier that is not active.

TADS-1035: internal error in remfuse/remdaemon/unnotify

This indicates an internal problem with TADS.

TADS-1036: load-on-demand loop: property not being set (internal)

This indicates an internal problem with TADS.

TADS-1037: undefined object in vocabulary tree

This indicates that a superclass object has not been defined.

TADS-1038: c-string conversion overflows buffer (internal limit)

This indicates an internal problem with TADS.

TADS-1039: invalid opcode (internal error)

This indicates an internal problem with TADS, or a corrupted game file.

TADS-1040: property evaluated for non-existent object

You have attempted to take a property of an object which has not been defined. This probably means that you are attempting to execute a game with compiler errors.

TADS-1041: unable to load external function "xxx"

The specified external function (user exit) is not available, because it has not been added to the game with the proper resource compiler (or other appropriate operating system-dependent mechanism). See appendix F for information on writing external functions.

TADS-1042: error executing external function "xxx"

The specified external function cannot be executed. See appendix F for information on writing external functions.

TADS-1043: circular synonym

You have declared a synonym which refers to another synonym which refers to the original synonym.

TADS-1500: invalid command-line usage

You have specified invalid command line arguments. This error will always be accompanied with an informational message describing the proper command line arguments.

TADS-1501: error opening input file

The debugger could not open the specified input file.

TADS-1502: game not compiled for debugging - use -ds option

You must use the -ds option when compiling your game if you wish to use it with the debugger.

TADS-2000: error setting breakpoint: unknown symbol

You have attempted to set a breakpoint on a non-existent symbol.

TADS-2001: I'm afraid I can't do that, Dave

The pod bay doors could not be opened. Check the AE-35 unit for a possible malfunction.

TADS-2002: error setting breakpoint: symbol is not a property

The specified symbol is not a property.

TADS-2003: error setting breakpoint: symbol is not a function

The specified symbol is not a function.

TADS-2004: error setting breakpoint: property not defined in object

The specified property is not defined in the specified object.

TADS-2005: error setting breakpoint: property is not code

The specified property is not code, but some other type of value. Breakpoints can only be set in executable code.

TADS-2006: error: breakpoint is already set at this location

You have attempted to set more than one breakpoint at the same location.

TADS-2007: error setting breakpoint: breakpoint not at line

You have attempted to set a breakpoint somewhere other than at a code location associated with a source line.

TADS-2008: too many breakpoints

The debugger cannot set any more breakpoints. You must remove one or more breakpoints before additional breakpoints can be set.

TADS-2009: breakpoint was not set

The breakpoint could not be set as requested.

TADS-2010: too many symbols in eval expression (internal limit)

You have specified an excessively complex expression. Simplify the expression.

TADS-2011unable to find source file "xxx"

The specified source file cannot be opened.

TADS-2012: assignment to local is illegal in watch expression

You cannot make an assignment to a local variable within a watch expression.

TADS-2013: inactive frame (expression value not available)

The specified frame can not be accessed because it is no longer active. The value of the expression can not be obtained.

TADS-2014: too many watch expressions

You must remove one or more watch expressions before setting additional watch expressions.

TADS-2015: watch expression not set

The requested watch expression could not be set.

TADS-2016: extraneous text after end of command

Your command has extra text past the end that the debugger did not understand.

TADS-2017: error setting breakpoint: symbol is not an object

The specified symbol is not an object.





A book may be very amusing with numerous errors, or it may be very dull without a single absurdity.
OLIVER GOLDSMITH, The Vicar of Wakefield (1766)


Appendix D Table of Contents Appendix F