Re: Inform: How to make a function optional?


22 Nov 1995 00:06:46 GMT

"Sam Hulick" <shulick@kiwi.ucs.indiana.edu> wrote:
> I simply want CreditRoutine() to be optional. If it is defined, then
> call it. if it's not defined, don't call it. How can I do this? I
> figured #Stub was the answer to this. Do I just do an #IFDEF
> CreditRoutine?

The directive

Stub routinename n;

is equivalent to

[ routinename x1 x2 ... xn; rfalse; ];

if `routinename' has not been defined yet, or to nothing at all if
`routinename' is defined. So you should put the `Stub' *after* the
point where you would define the routine if you wanted to. That's why
the library stubs are at the end of `grammar.h', because that's the
library file you `Include' last.

Note also that the `#' before a directive name is optional (as is the
capitalisation).

-- 
Gareth Rees