Jump to content

Conditional structures: Difference between revisions

no edit summary
No edit summary
Line 1,706:
Debug "Variable = something else..."
EndSelect</lang>
 
===CompilerIf===
Compiler conditional structures works like normal conditional structures, except they are evaluated at compile time, and thus have to use constant expressions. Any defined constant can be used, these examples uses built-in constants.
<lang PureBasic>
CompilerIf #PB_Compiler_OS = #PB_OS_Linux And #PB_Compiler_Processor = #PB_Processor_x86
Debug "Compiled on x86 Linux"
CompilerElse
Debug "Compiled on something else"
CompilerEndIf
</lang>
 
===CompilerSelect===
<lang PureBasic>
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Linux
Debug "Compiled on Linux"
CompilerCase #PB_OS_Windows
Debug "Compiled on Windows"
CompilerCase #PB_OS_MacOS
Debug "Compiled on Mac OS"
CompilerDefault
Debug "Compiled on something else"
CompilerEndIf
</lang>
 
=={{header|Python}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.