Hi allHave a undefined local variable error, that i can't seem to pick up. Here is a piece of the script[code:1:7186235057]
# Sorting code to rename and sort fitfiles into lists.procedure dirsetup (fitfiles) # Define procedure# Define procedure variablesstring fitfiles {prompt="The fitfiles to be used"}
bool filernm = yes {prompt="Rename fitfiles"}
bool sortfls = yes {prompt="Sort fitfiles"}struct *fitlistbegin # Define script variables
int i
bool renm, sortfiles
string ffiles, ftfls, data, fits, fitf, filter, .....
data = ""
filter = ""
# Make sure the necessary packages are loaded
if (!defpac ("imutil")){
bye()
}
;
# Check for null value for fitfiles
fitf = fitfiles
if (fitf != ""){
# Check the extn of files for non-fitfiles
i = strlen (fitf)
if ((substr (fitf, i-4, i) != ".fits") || (substr (fitf, i-3, i) != ".fit")) {
print("Warning: Incorrect filetype - Scipping file")
}
else {
# Expand the fitfiles template into a text file list
renm = filernm
if (filernm) {
rename (fitf, "fits", field="extn")
}
ffiles = mktemp ("tmp$setup")
sections (fitf, option="fullname", > ffiles)
}
}
else {
print("No fitfiles defined")
}
;
# Check if have to sort files
sortfiles = sortfls
if (sortfiles) {
# Redirect
ERROR -> fitlist = ffiles # Create lists
....
....# Code that is missing is just to create the different imagelists # Scan through the fitlist
while (fscan (fitlist, fits) != EOF) {
...
...
}
;
# Code that is missing is just the sorting code into the different lists # Clean up
fitlist = ""
delete (ffiles, ver-, >& "dev$null")end
[/code:1:7186235057]The code is used to rename and sort through fits files. The error is :ERROR - undefined local varieble "ffiles"
"fitlist = ffiles"If someone could help me on this. To sort the problem I have gone as far as to rewrite the whole script. Deleted the unneseccary .par files in the uparm dir, and did a mkiraf.I suspect that I am missing somthing small....
Please helpRegards
Pat