[fpc-pascal]Conditional compilation ELSE-IF?

Peter Vreman peter at freepascal.org
Thu Apr 8 17:27:46 CEST 2004


> --- Peter Vreman <peter at freepascal.org> wrote:
>> {$if defined(linux)}
>>   Slash:='/'
>> {$elseif defined(win32)}
>>   Slash:='\'
>> {$elseif defined(macos)}
>>   Slash:=':'
>> {$else}
>>   {$error Unsupported target}
>> {$endif}
>>
>> Better is to use PathSeparator from the System unit
>
> Thanks to everyone who responded.
>
> I just re-checked the docs (which are marked as current for 1.9; I'm
> using the 1.0.10 build) and they don't list an $ELSEIF which is
> consistent with the warning I get when I compile your code:
>
> verify.pas(50,2) Warning: Illegal compiler directive $ELSEIF
>
> But your pointer to the system unit was very helpful; I'll use
> system.DirectorySeparator, as you suggested.

It is only available in the current 1.9.3 development version.






More information about the fpc-pascal mailing list