Re: [CODE] That beautiful strlen_color function?
Re: [CODE] That beautiful strlen_color function?
ok, i've got a question about this too =P how do you use it... *shrug* i
know someone else had a snippet to do it, but i'd like to understand
where/how this works/where to put so i can play with it and use it where i
need it
--- altrag@realms.game.org wrote:
> well, probably not the same one but:
>
> int strlen_color(const char *str)
> {
> int l = 0;
>
> while (*str)
> {
> switch(*str)
> {
> case '&':
> if (str[1] == '-')
> {
> str += 2;
> ++l;
> break;
> }
> case '^':
> if (!str[1])
> ++str;
> else
> str += 2;
> if (str[1] == *str)
> ++l;
> break;
> default:
> ++str;
> }
> }
> return l;
> }
>
> On Tue, 28 Dec 1999 Sirkorlan@aol.com wrote:
>
> > Could someone please repost that nifty little strlen_color function
> that
> > was posted, I think, two or three months back? I have gone through the
>
> > archives and looked, but I couldn't find it. If anyone could, I'd be
> much
> > obliged. I thought that I'd saved a copy then, but was, much to my
> dismay,
> > wrong.
> >
> > *Covers his ISP name in hopes that doing so may bring better
> responses*
> > Hearty Thanks,
> > Sir Korlan
> >
>
>
> --------------------------------------------------
> Law of cookie theft:
> Your parents may not notice one missing from 20,
> They will notice 1/2 missing from 200.
>
>
=====
-Cecil
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com