1. Include Inside Conditional
- Posted by c.k.lester <euphoric at cklester.com> Feb 20, 2007
- 460 views
- Last edited Feb 21, 2007
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
2. Re: Include Inside Conditional
- Posted by Jerry Story <jstory at ocii.com> Feb 20, 2007
- 486 views
- Last edited Feb 21, 2007
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.
3. Re: Include Inside Conditional
- Posted by cklester <cklester at yahoo.com> Feb 21, 2007
- 507 views
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/