Cool, just find that 'holy grail' for someone else, and it's all good...

At least, that's my theory... :)

Cheers,

Pat 'sluggo' Magnan
Tour of Duty Mod
http://www.tourofdutymod.com

----- Original Message -----
From: "Mugsy _" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 8:13 PM
Subject: Re: [hlcoders] string to #define


>
> Yes! I had given up on this idea, but I guess I didn't imagine it after
all
> :) This is exactly what I was thinking of.
>
> Thanks for finding this
>
> Mugsy
>
> >From: "Pat Magnan" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: <[EMAIL PROTECTED]>
> >Subject: Re: [hlcoders] string to #define
> >Date: Tue, 28 May 2002 22:21:35 -0500
> >
> >Hey Mugsy:
> >
> >Did you ever figure this out? I was browsing the comp.lang.c newsgroup
FAQ
> >(ok, somebody needs a life :P), and found this:
> >Question 11.17
> >I'm trying to use the ANSI ``stringizing'' preprocessing operator `#' to
> >insert the value of a symbolic constant into a message, but it keeps
> >stringizing the macro's name rather than its value.
> >
> >-----------------------------------------------------
> >
> >You can use something like the following two-step procedure to force a
> >macro
> >to be expanded as well as stringized:
> >
> > #define Str(x) #x
> > #define Xstr(x) Str(x)
> > #define OP plus
> > char *opname = Xstr(OP);
> >
> >This code sets opname to "plus" rather than "OP".
> >
> >An equivalent circumlocution is necessary with the token-pasting operator
> >##
> >when the values (rather than the names) of two macros are to be
> >concatenated.
> >
> >References: ANSI Sec. 3.8.3.2, Sec. 3.8.3.5 example
> >ISO Sec. 6.8.3.2, Sec. 6.8.3.5
> >
> >
> >http://www.eskimo.com/~scs/C-faq/q11.17.html
> >
> >I think you were trying to get the preprocessor to expand and then
> >'stringize' your #define'd constant, passing it's value as the arg to
your
> >func, which is what that code appears to do.
> >
> >
> >
> >Pat 'sluggo' Magnan
> >Tour of Duty Mod
> >http://www.tourofdutymod.com
> >
> >
> >
> >
> >----- Original Message -----
> >From: "Mugsy _" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, May 07, 2002 2:29 AM
> >Subject: Re: [hlcoders] string to #define
> >
> >
> > > > > > > > > > The pre-processors scan through source files replacing
the
> > > >define
> > > > > >with
> > > > > > > > > > the value.
> > > > > > > > > >
> > > > > > > > > > I'm not 100% sure, but about 95% that it looks in
strings
> >as
> > > >well,
> > > > > >so
> > > > > > > > > >
> > > > > > > > > > someFuncThatTakesAString("WEAPON_GARAND");
> > > > > > > > > >
> > > > > > > > > > will get changed to
> > > > > > > > > >
> > > > > > > > > > someFuncThatTakesAString("2"); file://constant string
2\0
> > > > > > > > > >
> > > > > > > > > > before its compiled.
> >
> >
> >_______________________________________________
> >To unsubscribe, edit your list preferences, or view the list archives,
> >please visit:
> >http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to