Re: Curious question for act.comm.c

From: Del (caminturn@earthlink.net)
Date: 09/01/01


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);

--
   +---------------------------------------------------------------+
   | 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