Problem with Arguments

From: Cris Jacobin (jacobin@NETREACH.NET)
Date: 09/19/97

        Hello there.  Playing around with a small 'vending machine' object
special.  Having quite a bit of trouble after extracting the argument to the
buy command.

At the top of the function I have declared...

char itm_name[MAX_INPUT_LENGTH]


Further along we find the code giving me trouble...

else if (CMD_IS("buy")) {

   argument = one_argument(argument, itm_name);

     if (itm_name=="brown") {
          itm_cost=1000; }
        else if (itm_name=="white") {
           itm_cost=9000; }
          else if (itm_name=="black") {
            itm_cost=9000; }
           else {
             send_to_char("There is no such item.\r\n",ch);
             return (TRUE);

        code continues...

    Now I know itm_name contains the argument entered, since I printed it
out within the function via a little send_to_char(can_name,ch); function.

    Why the individual conditional statements never evaluate to true, I
can't figure out for the life of me.  It invariably falls down and executes
the else/default chunk, displaying, 'there is no such item.'

    Heh, I was so happy. My first attempt at a scratch piece of circle
code.  It compiled clean, the loading of an object into a char's inventory,
etc, everything worked.  Almost as big of a letdown as the Eagles/Cowgirls
game but
not quite.

    If someone out there could please give me a clue, I'd appreciate it.

-jac 'If there were a version of circle written in RPG/400, I'd fare better :)' 4000

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

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