Re: Curious question for act.comm.c

From: Artovil (artovil@arcanerealms.org)
Date: 09/01/01


At 11:07 2001-09-01 -0400, you wrote:
>Artovil wrote:
> > >In this function, where is buf1 and buf2 comming from? (are they not
> globals
> > >here?) Or am I missing somthing to understand what you're refering to?
> >
> > buf1 and buf2 are coming from the prompt, the player types write paper pen,
> > where paper = buf1, and pen = buf2, and to clarify that inside the function
> > they are set papername = buf1, penname = buf2, and so forth.
> >
>
>HUH??
>
>Where are you getting buf1 and buf2 from? The 'argument' is passed to
>ACMD(do_write) not buf1 and buf2, penname and papername are then set to buf1
>and buf2. Directly after it, they are being RESET to the two_arguments.
>Why?
>Its kinda like doing this:
>   mybuf = buf; /* lets make it equal to something? */
>   one_argument(argument, mybuf); /*lets actually make it equal to what we
> want
>*/
>
>
>
>ACMD(do_write)
>{
>   struct obj_data *paper, *pen = NULL;
>   char *papername, *penname;
>
>   papername = buf1;
>   penname = buf2;
>
>   two_arguments(argument, papername, penname);

Well, in a sense they are, aren't they?  They are split into two strings
from the argument.  I am not so well versed in code terms as you might be,
but I was still right in a sense, wasn't I?  I just didn't phrase it
properly.  Well, it makes some funky thing there by assigning papername to
buf1, so I see your point now.  Buf1 is pointless, it might as well just
use papername and penname and skip buf1 and buf2.  My fault for mixing it
up with functions that actually use buf1 and buf2 when splitting with
two_arguments.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



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