Re: [newbie] Arguments.

From: Heartless (pab1@KEENE.EDU)
Date: 07/15/97


On Tue, 15 Jul 1997, Rasdan wrote:

> Briefly,
>
> ACMD(do_retreat)
> {
>   int dir = 0;
>
>   one_argument(argument, arg);
>
>   if (is_abbrev(arg, "north"))
>     dir = 0;
>   else if (is_abbrev(arg, "south"))
>    .
>    . /* Put rest of direction stuff here */
>    .
>   else {
>     send_to_char("That is not a valid direction to retreat in\r\n", ch);
>     return;
>   }
>
> /* Do checks to see if EXIT(ch, dir) exists, then move them there */
>
> }
>
> Hope this helps,
>
> Rasdan

Indeed it does.  I finally figured it out myself, but I didn't know about
is_abbrev... I was using a switch (argument[1]), which i think is about
infinitely more tedious... thanks for the suggestions!


                <-------------------------------->
                |Paul Anderson Binder Jr.        |
                |    603-358-8854                |
                |           158.65.15.35 4000    |
                |http://csdept.keene.edu/~pbinder|
                <-------------------------------->


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



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