Page 1 of 1

Floating points in @elem

Posted: Tue Aug 02, 2011 10:11 pm
by nvellodi
I am writing a program that requires estimation over a number of different sample periods. I have successfully coded this using a series of nested while loops, with code such as:

smpl 1998:1 200!i:!j

where !i and !j are the floats I'm using to index the while loops. This works. However, when I try and call an element from a series using a similar expression:

scalar forerror = @elem(pi, "200!i:!j")

eviews doesn't like this, and says I've entered an illegal date. Am I doing something stupid here, or is it just that the @elem value doesn't allow floating points when one calls a date? I can work around this, by calculating the numerical indice of the element, but it seems strange.

Thanks,

Nikhil

Floating points in @elem

Posted: Tue Aug 02, 2011 10:59 pm
by EViews Gareth
You can't have ! variables inside quotes. Try:

Code: Select all

%s = "200" + @str(!i) + ":" + @str(!j) scalar forerror = @elem(pi, %s)

Re: Floating points in @elem

Posted: Wed Aug 03, 2011 4:55 pm
by nvellodi
Brilliant, nice trick. Also, the promptness of your response was startling. Many thanks.
Nikhil