Page 1 of 1

automatically numbering integer values

Posted: Thu Oct 25, 2012 4:22 pm
by paretto
Deat Tom,

thanks a lot for the help last time. Now I search for a way to automatically attach a number to the name of an integer.

I have the following procedure, where I want to compute the mean for different periods and store this mean in integer a.
To prevent that a is overwritten within the loop I want to number integer "a" by the value of i.
But some how I cant find the value a1, a3 ...
Where is the error?


dofor i = 1 3 6 12 24
stats claw12tayuk firstob+range+length lastob-i
comp a = %mean
comp a +(i) = a
end dofor

Is there something like a series window for integers, where I can see all integers defined in the program?

Thanks a lot

Re: automatically numbering integer values

Posted: Thu Oct 25, 2012 8:20 pm
by TomDoan
paretto wrote:Deat Tom,

thanks a lot for the help last time. Now I search for a way to automatically attach a number to the name of an integer.

I have the following procedure, where I want to compute the mean for different periods and store this mean in integer a.
To prevent that a is overwritten within the loop I want to number integer "a" by the value of i.
But some how I cant find the value a1, a3 ...
Where is the error?


dofor i = 1 3 6 12 24
stats claw12tayuk firstob+range+length lastob-i
comp a = %mean
comp a +(i) = a
end dofor
That won't work. The only things that can be created with created variable names are series. I'm not sure what you want to do with them, but this might work better:

Code: Select all

compute [vect[int]] ends=||1,3,6,12,24||
dec vect a(%size(ends))
do i=1,%size(ends)
   stats claw12tayuk firstob+range+length lastob-ends(i)
   compute a(i)=%mean
end do i
A will then have the five values, and ENDS will have the corresponding slots.
paretto wrote: Is there something like a series window for integers, where I can see all integers defined in the program?
The closest thing to this is the View--User Variables operation. Pick the "Scalars".