1. Re: No more platform(), conditional includes, conditional functions, condit

Jerry Story wrote:
> 
> How would you get the slash right without platform()?
> 
> }}}
<eucode>
> if platform() = LINUX then
>   SLASH = "/"
> else
>   SLASH = "\\"
> end if
> </eucode>
{{{


Well, two ways... 1, include file.e which defines PATHSEP and also NL depending
on platform or 2. almost exactly how you did it, but a new way w/much speed
improvements:

sequence SLASH
ifdef LINUX then
    SLASH = "/"
else
    SLASH = "\\"
end ifdef


This platform check takes place at parse/compile time not during runtime. The
difference is described in detail in:

http://www.openeuphoria.org/EUforum/m20892.html

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu