Hi,
I have a problem with Eviews, and it might be due to the addin that i have made, but i am not sure...?
If you install the global addin addtospec with the command
'indexinstall
addin(type=global, menu = "adds new string in a system equation" , proc="addtospec", desc="adds new string in a system equation") "./addtospec.prg"
and if you run the program "problem_with_addin.prg" on the attached workfile, Eviews will close. But I do not understand why...?
Trying to find the error, I noted something interisting,
Eviews will close when running the program
delete ags_s
svector ags_s=ags.@svectornb
!r=@rows(ags_s)
'add instruments
for !k=1 to 10' "r
'finding country and industry codes in each equation
%var=@word(ags_s(!k),1)
!length=@length(%var)
%id=@mid(ags_s(!k),11, !length-11)
'add instrument
addtospec(k=!k, add= @ log(tfpr_{%id}(-2)) ) ags 'addin that adds a line to the system specification
next
however, if only running
!r=@rows(ags_s)
'add instruments
for !k=1 to 10' "r
'finding country and industry codes in each equation
%var=@word(ags_s(!k),1)
!length=@length(%var)
%id=@mid(ags_s(!k),11, !length-11)
'add instrument
addtospec(k=!k, add= @ log(tfpr_{%id}(-2)) ) ags 'addin that adds a line to the system specification
next
Eviews will not crash. I do not understand why...
Can you please help me
Thomas
addin problem....?
Moderators: EViews Gareth, EViews Moderator
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
addin problem....?
- Attachments
-
- problem_with_addin.prg
- (392 Bytes) Downloaded 313 times
-
- problem_with_addin.WF1
- (642.95 KiB) Downloaded 276 times
-
- addtospec.prg
- (1.98 KiB) Downloaded 318 times
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: addin problem....?
Seemed to work just fine for me. Which version of EViews are you using, and what is the build date?
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Re: addin problem....?
Eviews 8, Jun 4 2014 build.
You might have to run it a couple of times before Eviews crashes.
Thanks for looking at this
Thomas
You might have to run it a couple of times before Eviews crashes.
Thanks for looking at this
Thomas
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Re: addin problem....?
Now it worked with the code I gave you. But if you run the code
svector ags_s=ags.@svectornb
'add instruments
for !k=1 to @rows(ags_s)
' 'finding country and industry codes in each equation
%var=@word(ags_s(!k),1)
!length=@length(%var)
%id=@mid(ags_s(!k),11, !length-11)
'add instrument
addtospec(k=!k, add= @ log(tfpr_{%id}(-2)) ) ags 'addin that adds a line to the system specification
next
it will crash.
Thomas
svector ags_s=ags.@svectornb
'add instruments
for !k=1 to @rows(ags_s)
' 'finding country and industry codes in each equation
%var=@word(ags_s(!k),1)
!length=@length(%var)
%id=@mid(ags_s(!k),11, !length-11)
'add instrument
addtospec(k=!k, add= @ log(tfpr_{%id}(-2)) ) ags 'addin that adds a line to the system specification
next
it will crash.
Thomas
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Re: addin problem....?
I tried it once more, when the loop goes from 1 to 10, and Eviews crashes again....
Thomas
Thomas
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: addin problem....?
Got it. It is an issue when a parent program accesses a data member of an object, then execs a program that deletes that object. We'll see if we can get it fixes asap (although this one is tricky...)
-
tvonbrasch
- Posts: 569
- Joined: Fri Apr 15, 2011 5:35 am
Re: addin problem....?
excellent, thanks!
thomas
thomas
Who is online
Users browsing this forum: No registered users and 1 guest
