comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Filling array in loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Filling array in loop [message #77007] Mon, 18 July 2011 11:06
Alexa is currently offline  Alexa
Messages: 8
Registered: June 2011
Junior Member
Hi All,

I'm trying to write a routine that loops through folders, grabs data
from each folder, and makes one large array out of all the
information. This is what I'm currently trying,

;;Open file with list of metallicities and put into an array
ReadCol, "MetalsList.txt", Metal, Format='a'
print, Metal

;;Create temporary arrays for the transitions
Result=FLTARR(41, 25)

;;Open the metals folders in order to read in col.txt

for nt=0, N_ELEMENTS(Metal)-1 do begin
cd, Metal[nt]
print, Metal[nt]
;;Read in column densities
ReadCol, 'Result.cd', U, result, Format='a'

cd, '..'

;Fill arrays

Result(nt)=[U, result]
print, Result
endfor


But instead of one large array, I get a smaller array for each folder.
Any suggestions on how I can fix this?
[Message index]
 
Read Message
Previous Topic: cgSnaphot doesn't detect currently open windows
Next Topic: Re: Filling array in loop

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:39:23 PDT 2025

Total time taken to generate the page: 0.00491 seconds