Passing parameter and run prg file in API

For posts that don't quite fit into any of the other forums, including posts about these forums themselves.

Moderators: EViews Gareth, EViews Moderator

lgazire
Posts: 16
Joined: Mon Feb 11, 2019 8:56 am

Passing parameter and run prg file in API

Postby lgazire » Mon Feb 11, 2019 9:54 am

All,

I read the COM documentation and did not find any specs regarding running the prg extension file through the api, is there a way to run it without being a wf1 file? Also, need to pass parameters through the execution, can it be done?

Currently using the Interop.Eviews version 10.

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

Re: Passing parameter and run prg file in API

Postby EViews Gareth » Mon Feb 11, 2019 10:09 am

Not entirely sure I understand the question, but you can issue an exec or run command through COM that will instruct EViews to run a .prg.

http://www.eviews.com/help/helpintro.ht ... -exec.html
Follow us on Twitter @IHSEViews

lgazire
Posts: 16
Joined: Mon Feb 11, 2019 8:56 am

Re: Passing parameter and run prg file in API

Postby lgazire » Mon Feb 11, 2019 10:28 am

EViews Gareth wrote:Not entirely sure I understand the question, but you can issue an exec or run command through COM that will instruct EViews to run a .prg.

http://www.eviews.com/help/helpintro.ht ... -exec.html



I manage to execute the via COM like this:

Code: Select all

   var manager = new Manager();
   var app = (IApplication10)manager.GetApplication(CreateType.ExistingOrNew, true);
   app.Run("exec prgFile");


But the thing is, when i do this it prompts me a screen asking for my database (SQL) user and password and i want to pass this as a parameter in the Run cmd.
Last edited by lgazire on Mon Feb 11, 2019 11:32 am, edited 2 times in total.

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

Re: Passing parameter and run prg file in API

Postby EViews Gareth » Mon Feb 11, 2019 10:37 am

The run and exec commands allow you to pass arguments and options to the .prg. The .prg could be written such that it uses those arguments or options to populate the fields of your SQL log in, presumably.
Follow us on Twitter @IHSEViews

lgazire
Posts: 16
Joined: Mon Feb 11, 2019 8:56 am

Re: Passing parameter and run prg file in API

Postby lgazire » Mon Feb 11, 2019 10:39 am

EViews Gareth wrote:The run and exec commands allow you to pass arguments and options to the .prg. The .prg could be written such that it uses those arguments or options to populate the fields of your SQL log in, presumably.


Hmm, nice, i will try to put the log in info in the prg file. Is there a documentation for this?

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

Re: Passing parameter and run prg file in API

Postby EViews Gareth » Mon Feb 11, 2019 11:35 am

Follow us on Twitter @IHSEViews


Return to “Any Other Business”

Who is online

Users browsing this forum: No registered users and 13 guests