Trying to test for a certain minimum version of FPC. Have got FPC version 2.7.1 [2011/09/17] for i386 on Windows.
What am I doing wrong? program conditional; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes; begin //How should I use FPCVULLVERSION in conditional compilation? {$IF $FPCFULLVERSION > 20200} writeln('Version newer than 2.2'); //Error: Compile time expression: //Wanted BOOLEAN but got INTEGER at IF or ELSEIF {$ENDIF} //so maybe the IF wants a precooked boolean result //let's try some brackets //Tried to apply Programmer's Guide 2.4 on Compile time expressions: {$MACRO+} {$IF (FPCFULLVERSION > 20200)} //Error: Compile time expression Wanted STRING but got INTEGER at //"FPCFULLVERSION > 20200" writeln('Version newer than 2.2 another try'); {$ENDIF} //adding a $: {$IF ($FPCFULLVERSION > 20200)} //Error: Syntax error while parsing a conditional compiling expression writeln('Version newer than 2.2 yet another'); {$ENDIF} end. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal