requires designide,rtl,vcl,{$IF RTLVersion < 19.0} // E2026 Constant expression expected //{$IF CompilerVersion = 22.0} // same as above vcljpg; {$ELSE} vclimg; {$IFEND}
它似乎在语法上是正确的.但是,编译器会对其进行扼流并报告预期的Constant表达式.这里到底发生了什么?
技术:目前仅在XE(15.0.3953.35171)上测试过.
当然,也欢迎变通方法的建议.
这样的事情
{$I MyDefines.INC} requires designide,{$IFDEF DELPHI_XE_UP} //the DELPHI_XE_UP is defineed inside of MyDefines.INC uNewlib; {$ELSE} uOldLib; {$ENDIF}