1. RE: Conditional/dynamic include

Hi Ken

I tried the Dynamic Include routine and the 2 problems I had were
1. the amount of extra code used to implement it (means more code 
sitting in memory)
2. It uses system_exec() to delete the temp include file, which pops a 
dos window up momentarily. Actually harmless but annoying on a Win32 
system

I have modified dbinterface.e to detect the platform and use puts() if 
it is Dos32 (again more code in memory unfortunately)

Also I modified Msgbox.e to work around the problem in there, and also 
use MB_XXXX constants and the IDXXXX return codes. I believe it will 
make msgbox.e a little more useful and hopefully portable for all. If 
anyone is interested I can send it into the archive.








Ken Rhodes wrote:
> 
> 
> Hi David,
> 
> A "conditional include" has been suggested and talked
> about on the list for several years.  Gabriel Boehme
> has posted a file that seems to accomplish that and
> can be downloaded here:
> http://www.rapideuphoria.com/dynincl.zip 
> 
> And who knows - maybe Rob Craig will add an "official"
> conditional include feature to Euphoria 2.5 - he
> recently added "pretty_print" which is kinda like an
> upgrade to "print.e" another neat file contributed by
> Gabriel Boehme.
> 
> Ken Rhodes
>   
> 
> --- David Davis <gdavis at hypercon.net> wrote:
> > 
> > 
> > Can I request conditional includes for the next
> > euphoria version? Or 
> > have I missed something in the docs again? It would
> > be handy to include 
> > a file based on the OS platform
> > 
> > Thanks Guys!
> > 
> >
> > TOPICA - Start your own email discussion group.
> > FREE!
> >
> >

new topic     » topic index » view message » categorize

2. RE: Conditional/dynamic include

Very Nice, A good way of building an app that will only be used on one 
platform, but still not as portable as I'd like since it cal only be 
changed at either the point of distribution, or binding. I believe 
Conditional Includes have been around nearly since the time of K&R and 
have been relativley bug-free since I began back in the stone age. :) It 
would be handy to send out an App with something like Dosinc.e and 
Wininc.e so the end user could use either platform or both if they 
choose



Igor Kachan wrote:
> 
> 
> Hello David,
> 
> Try please, is the code below too bad ?
> 
> -- code
> global procedure prepare_libs(sequence name, sequence list_libs)
>  integer fn 
>  fn=open(name, "wb")
>    puts(fn, list_libs[platform()])
>   close(fn)
> end procedure 
> 
> sequence conditional_libs
> conditional_libs ={
>  -------------------dos
>  "include c.e\n" & 
>  "include d.e\n" & 
>  "include e.e\n" ,
>  -------------------win
>  "include b.e\n" & 
>  "include f.e\n" & 
>  "include g.e\n" ,
>  -------------------lin 
>  "include a.e\n" & 
>  "include h.e\n" & 
>  "include i.e\n" }
>   
> prepare_libs("con_libs.e", conditional_libs)
> include con_libs.e   
> -- end of code
> 
> See please, you can make the *conditional* 
> including without any if & elsif & else conditions.
> 
> More complicated interpreter is more buggy interpreter.
> And just this current 'simple' interpreter is a great tool,
> I think. 
> 
> The code above works with translator and binder too.
> 
> Just delete old con_libs.e from the current directory then run code
> with ex.exe interpreter.
> You'll have new con_libs.e for the DOS platform in the current 
> directory. Then run bind code. You'll have .exe for DOS with that
> new con_libs.e included. 
> bind.bat must run ex.exe, not exw.exe.
> Then run ec with code, then run emake.bat and you'll have 
> compiled .exe for DOS.
> 
> Then delete con_libs.e for DOS from the current directory and run code
> with exw.exe interpreter.
> You'll have new con_libs.e for the WIN platform in the current 
> directory.
> Then run bindw code. You'll have .exe for WIN with that new con_libs.e
> included.
> bindw.bat must run exw.exe as it runs.
> Then run ecw with code, then run emake.bat and you'll have compiled .exe
> for WIN.
> So, the trick is to DELETE the bad con_libs.e and CREATE new good one
> with needed interpreter before binding or translation for the needed
> platform.
> 
> Regards,
> Igor Kachan
> kinz at peterlink.ru
> 
>

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

3. RE: Conditional/dynamic include

Yes, Please do send it to the archive! :)
And.. Thanks  :)
Ken Rhodes

> ... I modified Msgbox.e to work around the problem
> in there, and also 
> use MB_XXXX constants and the IDXXXX return codes. I
> believe it will 
> make msgbox.e a little more useful and hopefully
> portable for all. If 
> anyone is interested I can send it into the archive.
> 
> 
> Ken Rhodes wrote:
> > 
> > 
> > Hi David,
> > 
> > A "conditional include" has been suggested and
> talked
> > about on the list for several years.  Gabriel
> Boehme
> > has posted a file that seems to accomplish that
> and
> > can be downloaded here:
> > http://www.rapideuphoria.com/dynincl.zip 
> > 
> > And who knows - maybe Rob Craig will add an
> "official"
> > conditional include feature to Euphoria 2.5 - he
> > recently added "pretty_print" which is kinda like
> an
> > upgrade to "print.e" another neat file contributed
> by
> > Gabriel Boehme.
> > 
> > Ken Rhodes
> >   
> > 
> > --- David Davis <gdavis at hypercon.net> wrote:
> > > 
> > > 
> > > Can I request conditional includes for the next
> > > euphoria version? Or 
> > > have I missed something in the docs again? It
> would
> > > be handy to include 
> > > a file based on the OS platform
> > > 
> > > Thanks Guys!
> > > 
> > >
> > > TOPICA - Start your own email discussion group.
> > > FREE!
> > >
> > >
> 
> 
> TOPICA - Start your own email discussion group.
> FREE!
>
>
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu