Re: [CODE] Finding word in string

From: Christoffer Lundberg (avatar@ORION.BODEN.SE)
Date: 09/13/98


On Sun, 13 Sep 1998, Stephen Wolfe wrote:

> > The string is not a mobile's, it's a player's GET_TITLE() function which
> > I am using for an appearance. I wish to search through that string and
> > match the argument given with a word from the PC's title.
>
> i know you said you tried something with the isname function, but all you
> really need to do is change calls to isname to look like:
>
> (isname(arg, GET_NAME(ch)) || isname(arg, GET_TITLE(ch))
>
> if i were going to do this i would just make a macro:
> #define CH_NAME(arg, ch)        (isname(arg, GET_NAME(ch)) || \
>                                  isname(arg, GET_TITLE(ch))
>

Er, ok, It worked, until I tried to goto to a soldier. I misspelled the
argument of goto and accidently types go solf, and the MUD crashed. It
looks like if someone writes an argument that doesn't exist, the MUD will
crash. What can be wrong?

 _______________
() Christoffer  )
 | ~~~~~~~~~~~ |
 | Implementor |
 |     o f     |
 |   Legends   |
 |             |
 |  stargate.  |
 |   orion.    |
 |   boden.    |
 |  se  4000   |
 | ___________ |
()______________)


     +------------------------------------------------------------+
     | 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/15/00 PST