It doesnt have to be a define, it can be an enumerated variable. ( since
#define names would probably be tossed in a compiled version )
enum
{
WEAPON_GARAND = 2
};
>From: "Mugsy _" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [hlcoders] string to #define
>Date: Mon, 06 May 2002 19:17:02 -0700
>
>This is more general C++, but its for a HL mod so..
>
>If I have a string, is there a way to convert it to integer with a
>previously enumerated value?
>
>eg,
>#define WEAPON_GARAND 2
>
>then if I read in a string, and it happens to be "WEAPON_GARAND" can I know
>that that symbol is defined as 2? Obviously without doing an enormous
>if/else strcmp block..
>
>Mugsy
>Day of Defeat mod
>
>_________________________________________________________________
>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
>
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders