Raised This Month: $ Target: $400
 0% 

a simple question / case('X'):


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-07-2010 , 09:35   Re: a simple question / case('X'):
Reply With Quote #2

Show code, case is not a function, don't place ( and ) after it.

I am assuming you're using switch().
Code:
switch(variable)
{
     case 1: // variable is 1
     case 2..5: // variable is between 2 and 5
     default: // variable is none of above
}
If you use '8' it will be considered 8 as string, use that if you're checking a string.

Code:
new szText[] = "abc123"

switch(szText[0]) // "a"
{
      case 'a': // this will trigger
}

switch(szText[4]) // "2"
{
      case 2: // this won't trigger
      case '2': // this one will trigger
}
__________________
Hunter-Digital 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 00:17.


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