In "prototypes..." unixpython864 wrote:
> void do_function args((CHAR_DATA *ch, DO_FUN *do_fun, char *argument));
> theres the args() thing.. can someone please explain to me what the point of
> it is?
"Argument" is the term programmers use to refer to what mathemeticians
would call a variable and engineers call a parameter. It's the data
that the function works on, as it is input from the step before. That
step may be user input or a previous step in a longer routine. For
instance: look fido "look" is the command, "fido" is the argument.
In the example you posted:
void do_function args((CHAR_DATA *ch, DO_FUN *do_fun, char *argument));
"CHAR_DATA *ch" means the first argument type will be CHAR_DATA and it
will be *ch, which in ROM is always the 'enactor' - the person executing
the command.
"DO_FUN *do_fun" means the second argument will be one of the 'do'
functions (from the list in interp.c).
"char *argument" is for the argument to the do_fun. :)
Do_function takes any function and makes someone do it. For instance,
look at do_wake. It uses do_function to call do_look, sending the
char and a NULL for do_look, as you want to look at the room.
(note all do_funs pass only two arguments.)
Hope this helps,
Sandi
"I have not yet begun to code!"
[EMAIL PROTECTED] blades.inetsolve.com 3333