Exec and directory

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Exec and directory

Postby Sharky » Tue Dec 19, 2023 11:39 am

This is very strange and I can't see what I'm doing wrong.

The code

Code: Select all

cd "<...>\PhD version files"
<various minor routines>
exec ".\create all appex v5.prg"


When I run it, I get an error saying that the program 'create all appex v5.prg' isn't found on disk in a totally different place!

Code: Select all

<...>DOCUMENTS\EVIEWS ADDINS\CREATE ALL APPEX V5.PRG not found on disk in "EXEC ".\CREATE ALL APPEX V5.PRG"" on line 35.


I reset with cd directly and try running that line but each time it thinks I'm trying to call a program from an 'eviews addins' folder for some reason.

The status line has the correct Path.

I'm running Eviews 12 University Edition

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exec and directory

Postby EViews Gareth » Tue Dec 19, 2023 11:55 am

Follow us on Twitter @IHSEViews

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Re: Exec and directory

Postby Sharky » Wed Dec 20, 2023 2:34 am

EViews Gareth wrote:https://eviews.com/download/whitepapers/ExecInclude.pdf

Thanks Gareth. Any idea why it's calling from addins even though I'm using

Code: Select all

.\
?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exec and directory

Postby EViews Gareth » Wed Dec 20, 2023 8:16 am

Is the program you are running from saved to disk?
Follow us on Twitter @IHSEViews

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Re: Exec and directory

Postby Sharky » Wed Dec 20, 2023 8:39 am

EViews Gareth wrote:Is the program you are running from saved to disk?

Yes, saved to and running from C drive.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exec and directory

Postby EViews Gareth » Wed Dec 20, 2023 8:57 am

Is your copy of EViews up to date?
Follow us on Twitter @IHSEViews

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Re: Exec and directory

Postby Sharky » Wed Dec 20, 2023 10:05 am

EViews Gareth wrote:Is your copy of EViews up to date?

I downloaded Eviews 12 University edition about a month ago - is that up to date?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exec and directory

Postby EViews Gareth » Wed Dec 20, 2023 10:34 am

Should be.

Seems strange.

Can you do the following:

  • Create a brand new program.
  • Enter a single line:

    Code: Select all

    exec ".\foo.prg"
  • Save as "c:\temp\test.prg" (make sure you have a folder called test)
  • Run

It should error saying "c:\temp\foo.prg not found"
Follow us on Twitter @IHSEViews

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Re: Exec and directory

Postby Sharky » Wed Dec 20, 2023 12:38 pm

EViews Gareth wrote:Should be.

Seems strange.

Can you do the following:

  • Create a brand new program.
  • Enter a single line:

    Code: Select all

    exec ".\foo.prg"
  • Save as "c:\temp\test.prg" (make sure you have a folder called test)
  • Run

It should error saying "c:\temp\foo.prg not found"

Not sure what you mean by 'a folder called test' but I saved in both the location specified and a subfolder called 'test'. In both cases I got the error:

Code: Select all

C:\TEMP\TEST\FOO.PRG not found on disk in "EXEC ".\FOO.PRG"" on line 1.

Code: Select all

C:\TEMP\FOO.PRG not found on disk in "EXEC ".\FOO.PRG"" on line 1.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13323
Joined: Tue Sep 16, 2008 5:38 pm

Re: Exec and directory

Postby EViews Gareth » Wed Dec 20, 2023 12:40 pm

ok, so that appears to be working correctly. Something specific about your program is causing the weird behaviour.

(and I mean to say a folder called "temp". My bad)
Follow us on Twitter @IHSEViews

Sharky
Posts: 11
Joined: Tue Aug 16, 2016 6:51 am

Re: Exec and directory

Postby Sharky » Thu Dec 21, 2023 6:56 am

OK I've replaced with include and for some reason it works. Very strange.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 25 guests