I was wondering if there is a way to change the values of variables inside of a compiled IDL .pro file using a bunch of .txt files that contain the values.
For example I have 3 .txt files with 2 lines in each file. Lets just call them:
1. C:\input1.txt
2. C:\input2.txt
3. C:\input3.txt
Where the contents are something like:
hello
world
And the .pro I have looks like this:
pro tst1
common vars, a, b
infile = 'C:\input1.txt'
a =''
b =''
openr,lun, infile, /get_lun
readf,lun,a
readf,lun,b
end
pro tst2
common vars, a, b
tst1
print,a, b
end
What I want to do is change the infile variable for each iteration until all 3 input.txt files have been read.
Unfortunately, I do need to have the common blocks and the infile in the first pro. I am trying to automate a big nasty .pro I got (like my simple example) and its driving me a bit bonkers.