Newsgroups: rec.arts.int-fiction
Path: gmd.de!ira.uka.de!yale.edu!newsserver.jvnc.net!darwin.sura.net!gatech!destroyer!cs.ubc.ca!newsserver.sfu.ca!sfu.ca!neilg
From: neilg@fraser.sfu.ca (Neil K. Guy)
Subject: Avoiding TADS Compile Warnings
Message-ID: <neilg.729899007@sfu.ca>
Sender: news@sfu.ca
Organization: Simon Fraser University, Burnaby, B.C., Canada
Date: Tue, 16 Feb 1993 21:43:27 GMT
Lines: 70

 The latest versions of TADS (I'm using 2.0.13 right now) have a few
new customizing features. However, if you don't put certain functions
into your code you always get these compiler warnings "Warning -
'preparse' not found, etc.) every time you compile. The info file
that comes with the new compiler explains briefly how to avoid these,
but it took me a lot of fiddling around (and hassling Mike Roberts)
to understand exactly what to do. So, if you're a beginning TADS
author who wants to avoid these (harmless but not be aesthetically
pleasing) warning messages, here are some bits of code you should
put into your std.t file.

 If you're not going to process the user's input before the parser
gets its paws on it, then just put a preparse in like this:

preparse: function(parm)
{
	return true;
}

 If you want a default command prompt (just the traditional Infocom
">" prompt, then have a commandPrompt like this:

commandPrompt: function( parm )
{
	"\b>";
}

 Of course, if you want a look like the original Adventure you could
always put "\b?"; instead, for instance.

 If you want to use the default TADS error messages then put this
line in:

parseError: function(errno, str)
{
	return nil;
}

 Of course, the parseError function makes it easy to change the
messages if you want. For instance:

parseError: function( errno, str )
{
	switch ( errno )
	{
		case 1:
			return( 'I don\'t know the special character
			"%c." ' );
			break;
		case 24:
			return( 'I don\'t understand that
			sentence. ' );
			break;
		case 100:
			return( 'I\'m kind of confused. ' );
			break;
		case 110:
			return( 'I don\'t know how you can ' );
			break;
		default:
			return nil;
	}
}

 Then you would refer to pages 50 and 51 of the manual and change any
of the messages to whatever you like.

 So there you go. Hope this helps someone out there!

 - Neil K. (n_k_guy@sfu.ca)
