1. Include Inside Conditional

Why doesn't Euphoria allow an include statement inside a conditional clause?

if platform() = WIN32 then
   include win32.e
else
   include other.e
end if


That would seem to be the easiest solution to conditional includes, right?

Or create an 'import' statement that can handle variables.

if platform() = WIN32 then
   i = "win32.e"
else
   i = "other.e"
end if

import i


new topic     » topic index » view message » categorize

2. Re: Include Inside Conditional

c.k.lester wrote:
> 
> Why doesn't Euphoria allow an include statement inside a conditional clause?
> 
> }}}
<eucode>if platform() = WIN32 then
>    include win32.e
> else
>    include other.e
> end if</eucode>
{{{


In what case would you want that, considering that with wxEuphoria you can make
programs that run on both Windows and GNU/Linux?

If you do want that, it might make more sense to make two programs, one for
Windows and one for GNU/Linux.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Include Inside Conditional

Jerry Story wrote:
> c.k.lester wrote:
> > Why doesn't Euphoria allow an include statement inside a conditional clause?
> > }}}
<eucode>if platform() = WIN32 then
> >    include win32.e
> > else
> >    include other.e
> > end if</eucode>
{{{

> In what case would you want that, considering that with wxEuphoria you can
> make
> programs that run on both Windows and GNU/Linux?
> If you do want that, it might make more sense to make two programs, one for
> Windows and one for GNU/Linux.

Good points, Jerry. I'm sure I had a good example in my mind when I wrote
that, but it is gone from me, now. :)

I do know that console commands are different, however, such as for
deleting and moving files. I was thinking of those cases, like if I have,
a CGI program that I want to let run on Windows (IIS) and Linux (Apache).
I would need a cross-platform file commands library... but that's easy
enough to make, I suspect.

-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu