Current SVN version of Delphi Web Script now supports the following directives (all new but include and filter):
- $I, $INCLUDE, $F, $FILTER: include specified file (which can be on disk or come through the virtual file system), the FILTER variants will include the file after filtering it.
{$INCLUDE 'mysource.inc'}
- $DEFINE, $UNDEF: define and un-define a conditional.
{$DEFINE SPECIAL_CODE}
- $IFDEF, $IFNDEF, $ELSE, $ENDIF: allow specifying conditionally compiled blocks.
{$IFDEF SPECIAL_CODE} ...special code here... {$ELSE} ...not so special code here... {$ENDIF}
- $HINT, $WARNING, $ERROR, $FATAL: output a custom compiler hint, warning or error message.
{$HINT 'That is not wise...'} {$WARNING 'You should NOT be doing that!'} {$ERROR 'Do not do that. Period.'} {$FATAL 'After that, I won''t even try to compile your code!'}
Conditionals are case-insensitive names, conditional blocks can be nested.
Default conditionals when compiling can be adjusted via a new property in the TdwsConfiguration.
edit: added $FATAL