DescriptionCompilerIf <constant expression> ... [CompilerElseIf] ... [CompilerElse] ... CompilerEndIf
If the <constant expression> result is true, the code inside the CompilerIf will be compiled, else it will be totally ignored. It's useful when building multi-OSes programs to customize some programs part by using OS specific functions. The And and Or Keywords can be used in <constant expression> to combine multiple conditions.
CompilerIf #PB_Compiler_OS = #PB_OS_Linux And #PB_Compiler_Processor = #PB_Processor_x86 ; some Linux and x86 specific code. CompilerEndIf
DescriptionCompilerSelect <numeric constant> CompilerCase <numeric constant> ... [CompilerDefault] ... CompilerEndSelect
Works like a regular Select : EndSelect except that only one numeric value is allowed per case. It will tell the compiler which code should be compiled. It's useful when building multi-OSes programs to customize some programs part by using OS specific functions.
CompilerSelect #PB_Compiler_OS CompilerCase #PB_OS_AmigaOS ; some Amiga specific code CompilerCase #PB_OS_Linux ; some Linux specific code CompilerEndSelect
DescriptionCompilerError <string constant>
Generates an error, as if it was a syntax error and display the associated message. It can be useful when doing specialized routines, or to inform a source code is not available on an particular OS.
CompilerIf #PB_Compiler_OS = #PB_OS_AmigaOS CompilerError "AmigaOS isn't supported, sorry." CompilerElse CompilerError "OS supported, you can now comment me." CompilerEndIf
Enables or disables the explicit mode. When enabled, all the variables which are not explicitly declared with Define, Global, Protected or Static are not accepted and the compiler will raise an error. It can help to catch typo bugs.
EnableExplicit Define a a = 20 ; Ok, as declared with 'Define' b = 10 ; Will raise an error here
; ; Test = 10 EnableJS v_Test = 20 DisableJS Debug Test ; Will be 20