Re: More arguments?

From: The Nielsen Family (
Date: 01/08/01

> I want to make a command that accepts four different arguments,
> but since I have been unable to find another command that does
> this, I'm left in the dark...
> <command> <arg1> <arg2> <arg3> <arg4>

I personally use half_chop() (or used half_chop() before we migrated to a
String class), but there are several functions in interpreter.c that you
might look at (half_chop(), one_argument(), two_arguments(), etc).

Basically, half_chop(frog, bing, bong) takes the first word of "frog" and
stores it in "bing," and stores the remainder of "frog" in "bong," so you
can use half_chop() to your heart's content to break down the whole
argument.  Of course, always check to make sure "bing" and "bong" are not
NULL pointers after every call.


Jon A. Nielsen - /
Lazarus of Spear of Insanity MUD

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/03/01 PST