Re: argument help

From: Peter Ajamian (pajamian@cheapsam.com)
Date: 02/03/00


Magnus Jardstam wrote:
> >if (!strcmp(command_arg, "diag"))
> >   send_to_char("Diag...\r\n", ch);
> >
> >if (!strcmp(command_arg, "testing"))
> >   send_to_char("Testing...\r\n", ch);
>
> If you use strcmp then they have to type the words in the quotes EXACTLY as
> it says in the code, so in this case they must type say diag or say testing.
> Say Testing would not work and neither would say test. Use str_cmp if you
> wish it to be case-insensitive and if you wish them to be able to abbreviate
> the arguments then try this:

Actually !strcmp will work in this case because the one_argument()
function converts the argument to lower case, so as ong as you are
comparing against lower case there is no problem.  The point, however,
about abbreviations is well taken.

Regards, Peter


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT