Re: do_setshort

From: Cathy Gore (cheron@ARCANEREALMS.ORG)
Date: 12/23/02


On Mon, 23 Dec 2002 01:41:16 -0800, Phil <pwcroft@hotmail.com> wrote:

>ACMD(do_setshort) {
>  struct char_data *victim;
>  char name[MAX_INPUT_LENGTH], short_descr[MAX_INPUT_LENGTH]
>
>  two_arguments(argument, name, short_descr);
>  skip_spaces(short_descr);
>  delete_doubledollar(short_descr);
>
--snip--
>it almost worked, except that it
>would only include the first argument of the description.  For example:
>setshort bob a tall guy -- would show: a is standing here.  INSTEAD of:
>a tall guy is standing here.

Hmm, unless I've been away from my code for too long, two_arguments will
simply take the first two words (chars enclosed by spaces) and put them
into the second two variables given, returning the rest to the first.  What
you might want to try here instead is using half_chop (an oldie but a
goodie), or else, only one_argument.  Although half_chop might suit you
better.  As in:

ACMD(do_setshort)
{
  struct char_data *victim;
  char name[MAX_INPUT_LENGTH], short_descr[MAX_INPUT_LENGTH];

  half_chop(argument, name, short_descr);
  skip_spaces(&short_descr);
  delete_doubledollar(short_descr);
...
}

half_chop is found in interpreter.c (unless my modified version had moved
it there... don't remember), it's header is as follows:
/* return first space-delimited token in arg1; remainder of string in arg2
*/
void half_chop(char *string, char *arg1, char *arg2)

which seems to me what you're trying to do with two_arguments.

Hope this helps.
-Cheron
Co-Implementer, Arcane Realms
arcanerealms.org 3011

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT