It is worth reading these recovery methods if you are getting a delphi Debug Compiler Directive error code on your PC.
In addition to what lassevk said, you can also use a few other methods related to compiler evaluation (since Delphi 6, Believe), I personally have:
$IF NOT DECLARED(SOME_SYMBOL) // Warning: NOT required in this article$other$IFEND
CONDITIONAL EXPRESSIONS $IFDEF
For example, you can check the RTL version; From to to:
You can use the RTLVersion found in $IF Expressions for Testing the Entire Runtime Regardless of the level of the library some compiler version levels.
: $IF example RTLVersion 16 >=.2 … $IFEND
Currently, it is also possible to check the version of the compiler itself, again using the code:
CompilerVersion is assigned a value compiler if your system unit is up to date put together. This indicates a revision levels A/ compiler The syntax of a language that can specifically independently with the RTL version. CompilerVersion can be checked in $IF How should expressions be used? designed for VERxxx instead of testing determine conditionally. Always check PainLess or less than other known review status. this is bad find an idea certain version level.
Another thing I regularly do is define your symbol if it’s not already defined (handy for backwards compatibility), like the :
$IF NOT Art declared (utf8 string) UTF8String = Type AnsiString; $IFEND
#0 /var/www/html/shared/BaseWiki31/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1134): WikimediaRdbmsDatabase->reportConnectionError('Connection refused...')#1 /var/www/html/shared/BaseWiki31/includes/libs/rdbms/loadbalancer/LoadBalancer.php(749): WikimediaRdbmsLoadBalancer->reportConnectionError()#2 /var/www/html/shared/BaseWiki31/includes/GlobalFunctions.php(2801) WikimediaRdbmsLoadBalancer->getConnection(0, :Array, false)#3 /var/www/html/shared/BaseWiki31/includes/cache/location/LCStoreDB.php(45): wfGetDB(-1)#4 /var/www/html/shared/BaseWiki31/includes/cache/localisation/LocalisationCache.php(412): LCStoreDB->get('en', 'deps')#5 /var/www/html/shared/BaseWiki31/includes/cache/localisation/LocalisationCache.php(458): LocalizationCache->isExpired('en')#6 /var/www/html/shared/BaseWiki31/includes/cache/localisation/LocalisationCache.php(334): LocalizationCache->initLanguage('en')#7 /var/www/html/shared/BaseWiki31/includes/cache/localisation/LocalisationCache.php(371): LocalizationCache->loadItem('en', 'magicWords')#8 /var/www/html/shared/BaseWiki31/includes/cache/localisation/LocalisationCache.php(292): LocalizationCache->loadSubitem('en', 'magicWords', 'tree')#9 /var/www/html/shared/BaseWiki31/languages/Language.php(3177): LocationCache->getSubitem('en', 'magicWords', 'de evo')#10 /var/www/html/shared/BaseWiki31/includes/MagicWord.php(352): Language->getMagic(Object(MagicWord))#11 /var/www/html/shared/BaseWiki31/includes/MagicWord.php(280): MagicWord->load('tree')#12 /var/www/html/shared/BaseWiki31/includes/parser/Parser.php(4848): MagicWord::get('tree')#13 /var/www/html/shared/BaseWiki31/extensions/TreeAndMenu/TreeAndMenu_body.php(24): Parser->setFunctionHook('tree', Array)#14 /var/www/html/shared/BaseWiki31/includes/Setup.php(948): TreeAndMenu->setup()#15 /var/www/html/shared/BaseWiki31/includes/WebStart.php(88): require_once('/var/www/html/s...')#16 /var/www/html/shared/BaseWiki31/index.php(39): requires('/var/www/html/s...')#17 Main
$IfDef beginConditional compilation section.If
Nameis (due to presumed earlier occurrences of
$Define) thatSourcewise after
$IfDef information forcompiles to the appropriate or
$else compiler directive
$EndIf. In fact, there is not necessarily a problem
$else.You can conditionally nestCompilation sections.
General use, requiredThe conditional of which compilation is a test for editing in Delphi. Table B 8-1 lists theCompiler limits.with a compiler mark defining their tokens.
Table 8-1. Standard symbols