Re: Help Editor

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 02/16/00


StormeRider wrote:
>
> I'm installing the help editor on my MUD and was wondering about
> something...
>
> If you do "hedit blah", then the keyword will be "blah". Is there a
> function exisiting in Circle to uppercase an entire string or only
> the first character of the string?
>
> If not, shouldn't be too hard to write, but this way the keywords will
> match the look of the stock help files.

Extremely easy, here's an example...

/* This does not preserve the original, the return value is there only
to make it easy to use inline. */
char *make_upper(char *buf)
{
  char *ptr;

  for (ptr = buf; *ptr; ptr++) *ptr = UPPER(*ptr);

  return buf;
}

of course if you never plan on using it inline, then the following will
work just as well...

void make_upper(char *buf) { for (;*buf;buf++) *buf = UPPER(*buf); }

Regards, Peter


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT