Re: Tagged Obj/Wld/Mob/Zon files

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 12/25/97


At 08:02 PM 12/25/97 -0600, you wrote:
>Akuma/Chris Baggett/DOOMer wrote:
>
>> default : complain about unknown tag; break;
>
> What it seems you are asking is "how can I make an unknown tag log twice?".
>If the tag doesnt match any of the arguments, it goes to default. Make
default
>log the tag and move on.

you must have understood me somehow.
If the tag doesn't match any of the arguments it DOES NOT go to default
switch (*tag) {
case 'A': do this; break;
case 'B': do that; break;
default : complain about bad tag; break;
 } // End switch
it checks to see if the FIRST LETTER of tag (*tag) is a 'A'
if it is, it goes through and checks tag to some of the available tags
via strcmp().  if it doesn't match any of them, it hits the
'break;' statement, and bails out of the switch()
it never makes a log b/c of that reason.
and that's what I was asking.
lemme rephrase it then.
is it possible to use a goto default; statement as an ELSE option in that
if (!strcmp(tag, "Asomethin'))
else goto default;
break;
or should i completely drop all the break statements, and
wait for ALL those strcmps to go through before the default case
log()'s the bad tag?

again, thanks for any help.

Akuma the Raging Coder
-- No I am NOT a newbie.

  +----------------------------------------------------------------+
  |     "Yea, though I code in the Valley of the Shadow of No      |
  | Documentation, I will fear no task: for thy C Book is with me" |
  |          "Nothing is IMPOSSIBLE, Just IMPROBABLE"              |
  |     "Easier Said Than Done, But Better Done Than Said..."      |
  +----------------------------------------------------------------+


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