Raised This Month: $ Target: $400
 0% 

Constant in if statements?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 08-04-2011 , 09:46   Constant in if statements?
Reply With Quote #1

Let's say I have a constant like this:

PHP Code:
new const NUMBERS[][] =
{
     
10,
     
15,
     
30

How can I use them in a "if statement" like this

PHP Code:
if( gVariable == "any of the numbers inside const NUMBERS" 
?
Or do I have to do
PHP Code:
if( gVariable == 10 || 15 || 30 
Or
PHP Code:
if( gVariable == NUMBERS[0] || NUMBERS[1] || NUMBERS[2
?
Erox902 is offline
 



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 03:19.


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