Hi all,
I have problems with this simple lines of code:
if FConfigurationFileRec.ConfigVersion <> CONFIGVERSION then
raise exception.create(
Format('Versionsfehler: die angegebene Konfigurationsdatei hat Version %d.%d, benötigt wird Version %d.%d',
[Hi(FConfigurationFileRec.ConfigVersion), lo(FConfigurationFileRec.ConfigVersion), hi(CONFIGVERSION),
lo(CONFIGVERSION)]));
Both FConfigurationFileRec.ConfigVersion and CONFIGVERSION are declared Integer (=LongInt). FConfigurationRec.ConfigVersion contains value zero (0), CONFIGVERSION is $0201 (513), both values checked at runtime using the debugger. Nevertheless the exception never triggers. Stepping with the debugger, the comparison is executed, but execution continues at the line right after the raise.
I guess, however, that I struggle with a different problem, I think the comparison does actually evaluate to true, but for some reason, because of a problem with the optimization maybe, the raise line gets purged from the code.
Can anyone shed a light on how this code can fail?
Thnx, Armin.