Re: How to install Euphoria on a USB flash drive?

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

Bernie Ryan wrote:

> Why is everyone using batch files ?
> Why can't you have all your set commands
> given by a system() command in euphoria code.
> Put all these commands in a include file and
> then if you want to run a euphoria program all
> you have to do is include this file at the
> top of your program.

I tried the following:

-----------------[ sys_set.e ]-------------------
system("set EUDIR=h:\\prog\\euphoria", 2) -- h: is my USB drive
system("set EUINC=%eudir%\\inc_usr", 2)
system("set PATH=%eudir%\\bin;%PATH%", 2)
-------------------------------------------------

-----------------[ sys_test.exw ]-----------------
include sys_set.e   -- is located in the same directory

include math.e      -- private lib that contains abs()
? abs(-1)
--------------------------------------------------

It did not work (on Windows 98). IMHO this is because of two reasons:

a) Each system() command will start a new DOS shell. Environment
   variables that are set in a shell will vanish, when the shell doesn't
   exist any more, i.e. immediately after the concerning system()
   command has finished.

b) To avoid problem a), setx (suggested by Patrick) could be used
   (runs only on Windows NT,2000,XP,2003).
   But the main problem of your proposal IMHO is the following
   (please correct me if I'm wrong):
   The environment variables are set at runtime, but the Euphoria
   interpreter must know them beforehand, i.e. at parsing time!

Regards,
   Juergen

-- 
Have you read a good program lately?

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

Search



Quick Links

User menu

Not signed in.

Misc Menu