Raised This Month: $ Target: $400
 0% 

[ Solved ] #if , #elseif defined ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-14-2012 , 03:57   [ Solved ] #if , #elseif defined ...
Reply With Quote #1

Hello !

I've a question about it :
Code:
#if #elseif #else #endif
If they are more of these can you tell me.

So i don't understand and when can we do those check :
Code:
#if defined ??? && defined ??? public function(/*...*/) { /*...*/ } #endif

If you have some example...
Thanks
__________________
Pawn ? Useless
Aooka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-14-2012 , 05:42   Re: [ Request ] #if , #elseif defined ...
Reply With Quote #2

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Page 116

Code:
         #if  constant expression, #elseif, #else, #endif 

         Portions of  a  program may be  parsed or be  ignored depending  on 
         certain conditions.  The  pawn parser (compiler or interpreter) gen- 
         erates code only for those portions for which the condition is true. 

         The  directive  #if must  be  followed  by  a  constant  expression.          To 
         check  whether  a  variable  or  constant  is  defined,       use  the  defined 
         operator. 
         Zero or more #elseif directives may follow the initial #if directive. 
         These  blocks  are  skipped  if  any  of  the  preceding  #if or  #elseif 
         blocks were parsed (i.e.    not skipped).   As with the  #if directive, a 
         constant expression must follow the #elseif expression. 

         The #else causes the parser to skip all lines up to #endif if the pre- 
         ceding #if or any of the preceding #elseif directives were “true”, 
         and the parses these lines if all preceding blocks were skipped.  The 
         #else directive  may  be  omitted;  if  present,  there  may  be  only  be 
         one #else associated with each #if. 

         The  #endif directive terminates  a  program  portion that  is  parsed 
         conditionally.   Conditional  directives  can  be  nested  and  each  #if 
         directive must be ended by an #endif directive.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 07-14-2012 , 05:47   Re: [ Request ] #if , #elseif defined ...
Reply With Quote #3

Thanks
Solved
__________________
Pawn ? Useless

Last edited by Aooka; 07-14-2012 at 05:47.
Aooka 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 15:23.


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