Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Don't try to put the indices in the variable name - you'll regret it. Do this instead: col=reform(dep[0,0:499],50,10) then you can access your 'col1' with col[*,0], 'col11' with col[*,1] etc. Otherwise your next question will be "How do I loop through col1, col11...?" See previous post... https://groups.google.com/forum/?hl=en#!topic/comp.lang.idl- pvwave/XNn-lBi9DGQ cheers, greg
If you really need the index names, use (ordered) hash variable: You can use it as normal variables and also loop thru this IDL>dep = findgen(1,500) IDL>col = orderedhash() IDL>for i=0, 9 do $ IDL> col[string(i,form='(i1.1)')+'1'] = dep[0,(i*50):((i+1)*50)-1] IDL> foreach values, col, name do print,name IDL> help,col['31'] IDL> print,col['51'] A.