; ; idl structures, as in c, allow you to combine a variety of variables ; associated with a given data point ; m31 = create_struct('name','m31','mass',1.5d12,'pos',[1d0,0.1,2.d0]) help,m31,/str ; create another galaxy mw = create_struct('name','MW','mass',1.d12,'pos',[0d0,0.1,0.d0]) ; combine them local_group = create_struct('m31',m31,'mw',mw) help,local_group,/str ; print,' coordinates of second galaxy: ',local_group.(1).pos ; print all names of the galaxies in the local_group ngals = n_tags(local_group) for igal=0,ngals-1 do begin print,' name of galaxy ',igal,' in the group is ',local_group.(igal).name endfor end