IF ... #ENDIF Preprocessor Directive Example

In the following example, the #IF ... #ENDIF structure determines which version of Visual FoxPro compiles the program and then displays the appropriate message.

#IF 'WINDOWS' $ UPPER(VERSION( ))
   ? 'This was compiled under Visual FoxPro for Windows'
#ELIF 'MAC' $ UPPER(VERSION( ))
   ? 'This was compiled under Visual FoxPro for Macintosh'
#ELIF 'UNIX' $ UPPER(VERSION( ))
   ? 'This was compiled under FoxPro for UNIX'
#ELSE 
   ? 'This was compiled under FoxPro for MS-DOS'
#ENDIF

<+]