Welcome to iraf.net Friday, May 17 2024 @ 08:11 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Creating a new Task
   
Lianne
 11/26/2008 05:05PM (Read 4168 times)  
+----
Newbie

Status: offline


Registered: 11/24/2008
Posts: 8
I'm trying to create a new task in Iraf. I have been given a script[color=green:2de29b8269][i:2de29b8269]procedure markit (reffile)string reffile
string *flistbegin
flist = reffilewhile ( fscan (flist, s1) != EOF ) { if (access (s1) ) {
print ('Displaying ',s1 )
disp (s1, 1)
tvmark (1, s1//".mark", col=205, interactive=yes)
}
;
}end[/i:2de29b8269]
[/color:2de29b8269]I put this into notepad++ and saved it into the directory where I am working on my images. I called it markit.cl. Then in iraf I used the command to make the task. cl> task $markit = markit.clwhich works, then when I'm trying to call the task I get the following error:cl> markit
**: begin
^
ERROR: syntax error, line 6
called as: 'markit ()'
Any help would be much appreciated.

 
Profile Email
 Quote
fitz
 11/26/2008 05:05PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Because the task has parameters (i.e. arguments in the procedure declaration, more generally, anything before the 'begin'), you must declare it without the '$', e.g.[code:1:d5473f03f7]task markit = /path/markit.cl[/code:1:d5473f03f7]As for the syntax error, I think notepad may have put some control characters in the file that are causing the problem, the script runs fine for me (file created with 'vi').-Mike

 
Profile Email
 Quote
Lianne
 11/26/2008 05:05PM  
+----
Newbie

Status: offline


Registered: 11/24/2008
Posts: 8
Mike,Ok, I changed the editor to vim, and entered the command task markit = /iraf/markit.clThere is now an error that comes up saying...ERROR: task 'markit' has no param fileThanks!
Lianne

 
Profile Email
 Quote
fitz
 11/26/2008 05:05PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Do an "cl> unlearn markit" before running the task, its still using the param definition from the first time that lives in your uparm directory.

 
Profile Email
 Quote
Lianne
 11/26/2008 05:05PM  
+----
Newbie

Status: offline


Registered: 11/24/2008
Posts: 8
Ok, i did that, then logged out of iraf, then logged back in. Then I did it again
cl> unlearn markitand it came back with:
ERROR: task 'markit' not found
called as: 'unlearn markit ()'so I then created it again. cl> task markit = markit.cland again it came up with no param file.

 
Profile Email
 Quote
fitz
 11/26/2008 05:05PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[quote:5a6be4296b]cl> task markit = markit.cl[/quote:5a6be4296b]Is markit.cl in the current directory or in /iraf/markit.cl as in your last post? Since the parameters are part of the script, a 'has no param file' could also mean the script doesn't exist where the task declaration said it lives (which is the current directory if you don't specify a path).

 
Profile Email
 Quote
Lianne
 11/26/2008 05:05PM  
+----
Newbie

Status: offline


Registered: 11/24/2008
Posts: 8
The markit.cl file is in the current directory.

 
Profile Email
 Quote
fitz
 11/26/2008 05:05PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Did you do the 'unlearn' after the 'task' statement? Did you change directories after declaring the task?

 
Profile Email
 Quote
Lianne
 11/26/2008 05:05PM  
+----
Newbie

Status: offline


Registered: 11/24/2008
Posts: 8
I did unlearn before the task statement, and I've been in the same directory for everything.

 
Profile Email
 Quote
   
Content generated in: 0.29 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login