Re: Anybody Interested in this...

new topic     » topic index » view thread      » older message » newer message

Jeremy Peterson wrote:
> 
> Here's an example:
> x.ex
> }}}
<eucode>
> atom x x = 1
> if x then
> include x1.e
> end if
> puts(1, x)
> while get_key() = -1 do end while
> </eucode>
{{{

> 
> x1.e
> }}}
<eucode>
> global atom x
> x = 50
> </eucode>
{{{

> 
> It will crash with an error because you cannot include files in an if block.
> With Lua, replace the "include x.e" with "lua_dofile("x.lua")" and it will run
> all right.
> 
> Later,
> Jeremy Peterson.

Hi Jeramy,

As you have discovered, "include" is a top-level statement only. If you want
dynamic and/or condition inclusion functionability with Euphoria, you'll need to
use a special purpose library.

If you're using Euphoria v2.3 or newer, you can use the library I have
developed. There are other libraries, but none of them work on Euphoria v2.5 and
later, nor are they anywhere near as advanced.

All of these libraries can be found in the archive with a simple "dynamic
include" search query.


Regards,
Vincent

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu