1. include (variable with path/file) ?

Oh no!

I think I have run into the "conditional include" problem I've seen others
complain about!?

I just spent some time making a "search" routine to find whatever versions
of Win32Lib might be resident on a users system, so as to allow selection of
v50+, in order to find and run all the examples that are sent with it (just
in case it *wasn't* put into the "include" folder); but having *found* and
(user) selected a directory with Win32Lib.ew in it, (returned in
DirectoryWithWin32LibInIt), I then said:

include DirectoryWithWin32LibInIt & "Win32Lib.ew"

but it won't take it.  Won't take any variable placed there as far as I can
tell.

My suspicion is that there is *no* current solution to this, right??

Dan

new topic     » topic index » view message » categorize

2. Re: include (variable with path/file) ?

Dan B Moyer wrote:

> include DirectoryWithWin32LibInIt & "Win32Lib.ew"

You *could* write something like this:

   integer file
   file = open("dynamic.e", "w")
   puts( file, DirectoryWithWin32LibInIt & "Win32Lib.ew" & '\n' )
   close( file )
   include dynamic.e

But you won't be able to bind it!

-- David Cuny

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

3. Re: include (variable with path/file) ?

--- David Cuny <dcuny at LANSET.COM> wrote:

>
> You *could* write something like this:
>
>    integer file
>    file = open("dynamic.e", "w")
>    puts( file, DirectoryWithWin32LibInIt & "Win32Lib.ew" & '\n' )
>    close( file )
>    include dynamic.e
>
> But you won't be able to bind it!

There's actually a lib in the archives (I think called dynaminc) that takes
care of this for you.

Matt


=====
--
Matt Lewis
http://members.nbci.com/matthewlewis

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

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

4. Re: include (variable with path/file) ?

Matt,

Takes care of the "not able to bind", or the original include problem?

Dan

----- Original Message -----
From: "Matt Lewis" <matthewwalkerlewis at YAHOO.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 14, 2000 5:59 PM
Subject: Re: include (variable with path/file) ?


> --- David Cuny <dcuny at LANSET.COM> wrote:
>
> >
> > You *could* write something like this:
> >
> >    integer file
> >    file = open("dynamic.e", "w")
> >    puts( file, DirectoryWithWin32LibInIt & "Win32Lib.ew" & '\n' )
> >    close( file )
> >    include dynamic.e
> >
> > But you won't be able to bind it!
>
> There's actually a lib in the archives (I think called dynaminc) that
takes
> care of this for you.
>
> Matt
>
>
> =====
> --
> Matt Lewis
> http://members.nbci.com/matthewlewis
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/

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

5. Re: include (variable with path/file) ?

David,

And I thought I was up foo creek with a shoe that didn't fit!  Not able to
bind it is fine, it's for my Win32Lib Examples Gateway program.  Thanks!

Dan

----- Original Message -----
From: "David Cuny" <dcuny at LANSET.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 14, 2000 5:54 PM
Subject: Re: include (variable with path/file) ?


> Dan B Moyer wrote:
>
> > include DirectoryWithWin32LibInIt & "Win32Lib.ew"
>
> You *could* write something like this:
>
>    integer file
>    file = open("dynamic.e", "w")
>    puts( file, DirectoryWithWin32LibInIt & "Win32Lib.ew" & '\n' )
>    close( file )
>    include dynamic.e
>
> But you won't be able to bind it!
>
> -- David Cuny

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

6. Re: include (variable with path/file) ?

Dan B Moyer wrote:

> And I thought I was up foo creek with a shoe
> that didn't fit!  Not able to bind it is fine, it's for
> my Win32Lib Examples Gateway program.

Glad it helps. Pete was actually doing some pretty clever stuff with that
technique, but eventually had to scuttle it because of file limits.

-- David Cuny

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

7. Re: include (variable with path/file) ?

David,

But when I run it I get an error:

C:\Fuphoria\Win32Lib\Versions\v50\DirName.e:1
C has not been declared
C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew

yet if I write:

include C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew

it works just fine.  What's happening?

Dan

----- Original Message -----
From: "David Cuny" <dcuny at LANSET.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 14, 2000 5:54 PM
Subject: Re: include (variable with path/file) ?


> Dan B Moyer wrote:
>
> > include DirectoryWithWin32LibInIt & "Win32Lib.ew"
>
> You *could* write something like this:
>
>    integer file
>    file = open("dynamic.e", "w")
>    puts( file, DirectoryWithWin32LibInIt & "Win32Lib.ew" & '\n' )
>    close( file )
>    include dynamic.e
>
> But you won't be able to bind it!
>
> -- David Cuny

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

8. Re: include (variable with path/file) ?

On Thu, 14 Sep 2000, Dan B Moyer wrote:

> David,
>
> But when I run it I get an error:
>
> C:\Fuphoria\Win32Lib\Versions\v50\DirName.e:1
> C has not been declared
> C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew
>
> yet if I write:
>
> include C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew
>
> it works just fine.  What's happening?
>
> Dan
>
It's just like including a normal file. It won't take the text from the
included file and put it directly into your file. Instead, the include
file is parsed just as any other include file and it must conform to
Euphoria syntax. So given: include dynamic.e

Euphoria reads it like this:
C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew

instead of:
include C:\Fuphoria...

Of course, the interpreter has to use a seperate namespace for the local
identifiers etc., but that's basically how it's seen. Your entire include
statement is replaced, not just the file name.
 --
jeff

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

9. Re: include (variable with path/file) ?

<dense mode>

At first I couldn't understand what you were getting at, but eventually I
realized that what you were telling me was that I had to include the word
"include" in the file in front of the path/file, so the interpreter could
execute "include path/file", instead of trying to execute "path/file".
Thanks!

Dan

----- Original Message -----
From: "Jeffrey Fielding" <JJProg at CYBERBURY.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Thursday, September 14, 2000 7:05 PM
Subject: Re: include (variable with path/file) ?


> On Thu, 14 Sep 2000, Dan B Moyer wrote:
>
> > David,
> >
> > But when I run it I get an error:
> >
> > C:\Fuphoria\Win32Lib\Versions\v50\DirName.e:1
> > C has not been declared
> > C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew
> >
> > yet if I write:
> >
> > include C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew
> >
> > it works just fine.  What's happening?
> >
> > Dan
> >
> It's just like including a normal file. It won't take the text from the
> included file and put it directly into your file. Instead, the include
> file is parsed just as any other include file and it must conform to
> Euphoria syntax. So given: include dynamic.e
>
> Euphoria reads it like this:
> C:\Fuphoria\Win32Lib\Versions\v50\Win32Lib.ew
>
> instead of:
> include C:\Fuphoria...
>
> Of course, the interpreter has to use a seperate namespace for the local
> identifiers etc., but that's basically how it's seen. Your entire include
> statement is replaced, not just the file name.
>  --
> jeff

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

10. Re: include (variable with path/file) ?

On Thu, 14 Sep 2000, Dan B Moyer wrote:

> <dense mode>
>
> At first I couldn't understand what you were getting at, but eventually I
> realized that what you were telling me was that I had to include the word
> "include" in the file in front of the path/file, so the interpreter could
> execute "include path/file", instead of trying to execute "path/file".
> Thanks!
>
> Dan
>

Sorry I didn't simplify my answer... I guess I'm in a verbose mode
today... need sleep/caffinated beverages...

coke myCocaCola
myCocaCola = find(coke, myCokeStockpile)
drink(myCocaCola)

--
jeff

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

Search



Quick Links

User menu

Not signed in.

Misc Menu