Re: [CODE] Finding word in string

From: Stephen Wolfe (siv@CYBERENET.NET)
Date: 09/13/98


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

isname takes one argument for the word we are trying to find, and the
second argument is a wordlist separated by spaces (just like a title would
be)..maybe you should read the code a little more closely..

siv


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