Raised This Month: $51 Target: $400
 12% 

Defines


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 07-16-2010 , 16:41   Defines
Reply With Quote #1

Code:
#define PLUGIN  "NSA-CO-General" #if defined PLUGIN "Yo" new LOL = 0 #endif

I only want the variable to be declared if the define equals "Yo". Is this possible?
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-16-2010 , 16:45   Re: Defines
Reply With Quote #2

#if PLUGIN == "Yo"
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 07-16-2010 , 16:48   Re: Defines
Reply With Quote #3

Quote:
error 033: array must be indexed (variable "-unknown-")
Weird O_o

Below, this works, because it is an integer, but I don't know if you can compare strings...anyone?
Code:
#define LOL 2 #if LOL == 1 new LOL1 = 0; #endif #if LOL == 2 new LOL2 = 0; #endif
__________________


Last edited by mysticssjgoku4; 07-16-2010 at 16:53.
mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-16-2010 , 17:15   Re: Defines
Reply With Quote #4

Use ()
PattyBiena is offline
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 07-16-2010 , 17:35   Re: Defines
Reply With Quote #5

What do you mean? None of these work.
Code:
#if (PLUGIN == "Yo") new LOL = 0 #endif #if (PLUGIN) == "Yo" new LOL = 0 #endif #if PLUGIN == ("Yo") new LOL = 0 #endif #if PLUGIN ("Yo") new LOL = 0 #endif if (PLUGIN) "Yo" new LOL = 0 #endif
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 07-17-2010 , 15:20   Re: Defines
Reply With Quote #6

Quote:
Originally Posted by mysticssjgoku4 View Post
What do you mean? None of these work.
Code:
#if (PLUGIN == "Yo") new LOL = 0 #endif #if (PLUGIN) == "Yo" new LOL = 0 #endif #if PLUGIN == ("Yo") new LOL = 0 #endif #if PLUGIN ("Yo") new LOL = 0 #endif if (PLUGIN) "Yo" new LOL = 0 #endif
I do not think that it is possible to compare defined strings because it is a useless feature. You only need int values for comparison.
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode