View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Newline error.

H.J. van Heerden wrote on Apr 02, 2007

Hi all

I get the following error message when I try to run a script.

boyden> dirsetup
ERROR: Newline while processing string
"# Set the environment"
line 26: boyden$dirsetup.cl
called as: `dirsetup ()'

Here is the script

# Dirsetup script for creating datalists of the appropriate files from the
# header field values. Thus creates lists containing the dark-, bias-, object-
# and filter specific flatframes.

procedure	dirsetup (fitfiles)	# Define procedure

# Define procedure variables

string	fitfiles	{prompt="The fitfiles to be listed"}

struct	*fitlist

begin

	# Define script variables
	string	ffiles, fits, data, biaslist, darklist, flatlist, imagelist
	
	# Make sure the necessary packages are loaded
	if (! defpac ("imutil")){
		bye()
	}
	;
		
	# Set the environment
	unlearn all
	unlearn allphot, biasred, darkred, fixheader, flatred, magcor, reduction, stardump
		
	# Expand the fitfiles template into a text file list
	ffiles = mktemp ("tmp$setup")
	sections (fitfiles, option="fullname", > ffiles)
	
	# Redirect
	fitlist = ffiles
	biaslist = "biaslist"
	darklist = "darklist"
	flatlist = "flatlist"
	imagelist = "imagelist
		
	# Scan through the fitlist
	while (fscan (fitlist, fits) != EOF) {
		
		# Get the exptype from the fit files
		hselect (fits, "EXPTYPE", yes) | scan(data)
		
		if (nscan() != 0) {
			
			# Write the fit-files to specific predefined lists
			if (data == "BIAS") {
				sections (fits, option="fullname", >> biaslist)
			}
			else if (data == "DARK") {
				sections (fits, option="fullname", >> darklist)
			}
			else if (data = "FLAT") {
				sections (fits, option="fullname", >> flatlist)
			}
			else if (data = "DATA") {
				sections (fits, option="fullname", >> imagelist)
			}
			;	
		}
		;
	}
	;
	
	# Clean up
	delete (ffiles, ver-, >& "dev$null")

end


I did a search on the error, but mine does not seem to correspond the the other newline error that I saw. I went through all the files for the external boyden package that I build, but could not find the error. The script did not give any errors until I added the "If-else" statements for the file sorting into lists.

Thanx

Regards
Pat

Mike Fitzpatrick wrote on Apr 02, 2007

Pat,

The error message is wrong about where it's happening. Your problem is a missing closing quote when setting 'imagelist'

-Mike

H.J. van Heerden wrote on Apr 02, 2007

Hi Mike

I feel silly for making such a mistake. :oops: I can't believe that I would have missed something like that. Might be due to the closing deadlines.

Sorry for the inconvenience.

Thanx
Pat

Last post on Apr 02, 2007