Page 1 of 1

Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 9:54 am
by lgazire
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.

Re: Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 10:09 am
by EViews Gareth
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

Re: Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 10:28 am
by lgazire
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.

Re: Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 10:37 am
by EViews Gareth
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.

Re: Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 10:39 am
by lgazire
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?

Re: Passing parameter and run prg file in API

Posted: Mon Feb 11, 2019 11:35 am
by EViews Gareth