[fpc-pascal]Conditional compilation ELSE-IF?

Alan Mead cubrewer at yahoo.com
Thu Apr 8 16:37:23 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.

Thanks again.

-Alan


__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/




More information about the fpc-pascal mailing list