Re: [CODE] SPECIAL(Sage) den.se>

From: Mark A. Heilpern (heilpern@MINDSPRING.COM)
Date: 12/08/97


At 01:03 PM 12/8/97 +0100, you wrote:
>There's only a slight problem with the code. When compiling, it says
>that 'control reaches end of non-void function'.

Specprocs are not void functions. (That is, they return a value.) Your
warning is telling you the function is not void, yet it is not actively
returning something. Instead, it is hitting the closing brace. When this
happens, the returned value from the function will be whatever happens to
be in the register (or on the stack).

Spec procs are supposed to return 0 to mean the specproc did not do anything
(for example, your CMD_IS() is false) and non-zero to say it ran its
special code. (If you run but decide there is a user error, like you cant
find the object, you should still return a non-zero).


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST