One of our subroutines is no longer working (although we've made no changes to the code). I've attached the error message.
Specifically, the error is in this line:
series s1adj=s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
Both %firstdate2 and %firstdate2 are defined properly, and the line "smpl %firstdate1 %firstdate2" works as expected. The command in the attached error message also works fine in the command line.
Any thoughts?
sample/string error in subroutine
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
sample/string error in subroutine
- Attachments
-
- Capture.PNG (17.85 KiB) Viewed 3125 times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: sample/string error in subroutine
Hard to say without more context. A simple example seems to work:
Code: Select all
create m 1990 2000
series s1=nrnd
series s2=nrnd
call foo("1991m01", "1991m02")
subroutine foo(string %firstdate1, string %firstdate2)
series s1adj = s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
endsub
Follow us on Twitter @IHSEViews
Re: sample/string error in subroutine
Thanks for the quick response. The example posted gives me the same error. I managed to work around it by splitting the line into two:
!tempscalar=@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
series s1adj=s1*!tempscalar
Old Code
'series s1adj=s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
I'm using the July 19 build by the way, not sure if this is related.
''''''''''''''''''UPDATE''''''''''''''''''
Updating EViews with the new patch fixed the issue
!tempscalar=@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
series s1adj=s1*!tempscalar
Old Code
'series s1adj=s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
I'm using the July 19 build by the way, not sure if this is related.
''''''''''''''''''UPDATE''''''''''''''''''
Updating EViews with the new patch fixed the issue
Who is online
Users browsing this forum: No registered users and 26 guests