When should I use @loadprgini

For questions regarding programming in the EViews programming language.

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

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

When should I use @loadprgini

Postby johansamuelsson » Mon Mar 14, 2016 11:42 pm

Hi

In 9.5 theres are the new options "@loadprgini" and "@saveprgini"

I'm a little unsure of the difference between using INI files and PRG files. For example you can extract the information "3" from the

ini-file

Code: Select all

[default]
hello=3

or the prg-file

Code: Select all

%hello = "3"


What's the main advantage of reading information from ini-files, in which circumstances are ini-files preferable?

Moreover, there seems to be some other exciting things in 9.5, fun!

Regards Johan

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

Re: When should I use @loadprgini

Postby EViews Gareth » Tue Mar 15, 2016 5:54 am

Loadprgini let's you create a program that can permanently change its own settings. It is intended for situations where the writer of the program is not necessarily the same person as the user of the program, such as with Add-ins.

You may have an Add-in that shades a specific area on a graph. Previously if you wanted the user to choose the color of the shade you would have to ask them every time they ran the add-in. Now you can ask them the first time they run and ask them if they want to set the color as the default for ever more.
Follow us on Twitter @IHSEViews

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: When should I use @loadprgini

Postby johansamuelsson » Tue Mar 15, 2016 7:05 am

Ok, I see.

A related question, any plans to make "Graph70.ini" editable (if it's possibly)?

Regards Johan

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

Re: When should I use @loadprgini

Postby EViews Gareth » Tue Mar 15, 2016 7:32 am

Editable in what way?
Follow us on Twitter @IHSEViews

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: When should I use @loadprgini

Postby johansamuelsson » Tue Mar 15, 2016 8:07 am

I guess "Graph70.ini" is the output-file from the options the user could do by the meny "Options" / "Graphics Defaults".

So if "Graph70.ini" could be editable in an ordinary text editor, just like for example "EViews32.ini" or "ProgReg.ini" it would be much easer to controll this options and distribute them to all our user (like we do with "ProgReg.ini" and some rows in "EViews32.ini").

The alternative way is using "optsave", but we think that coding is more efficient and reliable.

When opening "Graph70.ini" in a ordinary texteditor its not readable.

Regards Johan

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

Re: When should I use @loadprgini

Postby EViews Gareth » Tue Mar 15, 2016 8:15 am

Ah, right. That's tricky/impossible.
Follow us on Twitter @IHSEViews

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: When should I use @loadprgini

Postby johansamuelsson » Tue Mar 15, 2016 8:38 am

By curiosity, how come?

Regards Johan

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

Re: When should I use @loadprgini

Postby EViews Gareth » Tue Mar 15, 2016 8:55 am

Graph settings aren't stored as a set of text options. They're stored as graphs objects. EViews loads up that graph object and applies its settings as the defaults.

Since graph objects (and all other EViews objects) are stored in a proprietary binary format, it isn't simple to convert it to a simple text specification.
Follow us on Twitter @IHSEViews

johansamuelsson
Posts: 160
Joined: Thu Mar 03, 2011 10:07 pm
Contact:

Re: When should I use @loadprgini

Postby johansamuelsson » Tue Mar 15, 2016 9:25 am

Ok, I see. An alternative would be if all global options settings under the meny "Graphics Defaults..." also could be mananged by ordinary Eviews code.

Regards Johan


Return to “Programming”

Who is online

Users browsing this forum: Google [Bot] and 13 guests