Re: [CODE] More arguments :(

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 10/05/97


On Saturday, October 04, 1997 10:03 PM, Daniel Koepke
[SMTP:dkoepke@CALIFORNIA.COM] wrote:
> On Sat, 4 Oct 1997, Gary Barnett wrote:
>
> -+  int argu=0;
> -+
> -+  skip_spaces(&argument);
> -+  one_argument(argument, buf);
> -+  if (*buf && is_number(buf))
> -+     argu = atoi(buf);
> -+  sprintf(buf, "Numerical Argument: %d", argu);
> -+  send_to_char(buf, ch);
>
> Hm, no, I think you just complicated the code without fixing the
> problem (although the *buf check _is_ a very good thing to have).
> My suggestion is to try this test ACMD, cut-and-paste it into your
> MUD to make sure you get it *EXACTLY* as typed (unless I made a
> typo, and then I'll feel stupid).  If this works fine, then
> there's something wrong with the code you have in your MUD:

Umm. I created a routine that solved the requested problem within
parameters. He specifically asked for a routine that would return 0
if a non-number was returned, and didn't specify that a differentiation
between the number 0 and a non-valid response be broken out.

In either case the addition of an else to the if would solve the problem
handily while being simple enough.

<snip>

Just my thoughts...

--Mallory
I can picture in my mind a world without war, a world without hate.
And I can picture us attacking that world, because they'd never
expect it.     - Jack Handey


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



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