Re: Include system
- Posted by Chris Bensler <bensler at nt.net> Dec 30, 2006
- 1123 views
Derek Parnell wrote: > > >posted by: ags <eu at 531pi.co.nz> > > > > > >Hi All > > > >I've just had a thought about the include system, well an observation > > really. > > > >A program in a sub folder of an include file can say something like: > > > >include ..\file_one.e > > > >Which sucessfully includes a file from one directory level up. > > > >But if that file_one.e includes another file from the folder it is in, > > eg file_two.e, > >the interpreter will not be able to locate it. > > > As we all know, included files that are expressed in relative terms rather > than > absolute (full path) terms are all relative to a set of 'include' paths. These > paths are defined as ... > > ** The directory in which the executing program resides. > ** The list of directories specified in the EUINC environment variable. > ** The directory ${EUDIR}/include, where EUDIR is the environment variable > that specifies where Euphoria was installed. > > What would be useful, is a way to specify in the include file name that we > want > it relative to the file which is doing the including. <SNIP> The revision I made addresses this by ammending the search rules to default to the directory the calling file resides in. So if test/foo/bar.e includes fubar/foo.e It will first look for foo.e in test/foo/fubar/ Else look in test/fubar/ Else look in EUINC/fubar/ Else look in EUDIR/include/fubar/ It's always a natural relation. Is it necessary to enforce the new behaviour, or otherwise make it explicit? Chris Bensler ~ The difference between ordinary and extraordinary is that little extra ~ http://empire.iwireweb.com - Empire for Euphoria