A loop and an increasing variable name.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

A loop and an increasing variable name.

Gekko
Hi there,

I have a general problem (not onyl in this case). Often, variables are named
like var1, var2, var3...
and often we have to run the same procedures on variables 1 to n.
Insead of copying every syntx and change the numbers manually, I would like
to leave SPSS doing that for me in a loop - but unfortunately, I dont know
how to name the variables in that case.

Here an example - and what it should look like, but in that way it doesnt
work, so I think there has to be altered something in the [] or so..

LOOP #I = 1 to 10.
- COMPUTE var[I]=value[I]+1.
END LOOP.



thanks a lot for every kind of help
Kind regards
Stefan
--
View this message in context: http://www.nabble.com/A-loop-and-an-increasing-variable-name.-tf3982480.html#a11305925
Sent from the SPSSX Discussion mailing list archive at Nabble.com.