Page 1 of 1

base path for INCLUDE

Posted: Sat Sep 05, 2015 7:03 pm
by maxchen
EV 9 20150825, xp

In p709, Command Reference: If an include file is specified without an absolute path, the base location will be taken from the location of the program file, not from the default directory.
However, there are more stories.
Soure prg files
(666 Bytes) Downloaded 128 times

unpack the attachment, run Test-path.prg, you will see the results of table tb:

note that
* the default dir is "E:\DOC\HEDGE\GC".
* For @linepath and @runpath, the return strings are ended with "\", other functions are not (I hope them consistently ended with or without "\").

run Test-path1.prg, you see the error

* base path for INCLUDE: E:\DOC\EV9\TESTPATH2\EXEC\

run Test-path2.prg, you see the error
E:\DOC\EV9\TMPI\TEST4.prg not found on disk in "EXEC E:\DOC\EV9\TESTPATH2\EXEC\TEST-PATH-E2".

* base path for INCLUDE: E:\DOC\EV9\TESTPATH2\

run Test-path3.prg, you see the error
E:\..\TMPI\TEST4.prg not found on disk in "EXEC E:\DOC\EV9\TESTPATH2\EXEC\TEST-PATH-E3".

* base path for INCLUDE: E:\

Therefore, what really is the base path for INCLUDE? How about set it to be @linepath of parent program

Re: base path for INCLUDE

Posted: Sat Sep 05, 2015 8:11 pm
by EViews Gareth

Re: base path for INCLUDE

Posted: Sun Sep 06, 2015 1:34 am
by maxchen
I have just read it. However, there still some puzzle:

According to the white paper: For context no prefix and ".\" , both base on linepath, and "..\" goes to above linepath
* Test-path.prg -> exec Test-path-e.prg: no prefix, should fire an error, but works smooth
* Test-path1.prg -> exec Test-path-e1.prg, ".\", an error
* Test-path2.prg -> exec Test-path-e2.prg, "..\", expected to work but fail

Re: base path for INCLUDE

Posted: Mon Sep 28, 2015 6:13 pm
by maxchen
with EViews9Patch_092815.exe , not fixed yet.

according to the white paper,


Code: Select all

include tmpI\Test4   'Test-path-e.prg
' include .\tmpI\Test4   'Test-path-e1.prg
' include ..\tmpI\Test4   'Test-path-e2.prg
' include \..\tmpI\Test4   'Test-path-e3.prg

Test-path2.prg should work and Test-path.prg should fail. However, the result is reversed.

Re: base path for INCLUDE

Posted: Mon Sep 28, 2015 6:56 pm
by maxchen
include :
(no prefix) -> runpath;
' ".\" ->linepath;
"..\" -> runpath;
".\..\"-> above linepath

However, the white paper reports that both "no prefix" and "..\" point to linepath

Re: base path for INCLUDE

Posted: Tue Sep 29, 2015 8:58 am
by EViews Gareth
True. We should update the whitepaper to reflect that include with no prefix refers to runpath.

You're always better off being more explicit by using .\ and .\..\ rather than no prefix.