Welcome to iraf.net Thursday, March 28 2024 @ 02:13 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Syntax Error on procedure call
   
LukeD
 03/02/2017 07:51AM (Read 1155 times)  
+----
Newbie

Status: offline


Registered: 03/02/2017
Posts: 1
I am trying to create my first procedure script by creating a .cl script, placing it in /home/iraf/listcreate.cl and then running
task listcreate = /home/iraf/listcreate.cl

but whenever I try to run it by typing 'listcreate' I get an error:
**: procedure listcreate (output)
^

ERROR: syntax error

This is listcreate.cl;

procedure listcreate (output)
string output {prompt="Output List prefix"}
begin
files *.fits \$this->_split2($m[0]) output//"list_master"
end

Can anyone help me find out whats wrong?

Also if anyone could help me with the syntax for making the output list prefix a user defined variable, that'd be great!!

Thanks,

Luke

 
Profile Email
 Quote
fitz
 03/08/2017 05:15PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
I don't understand the specific error message since there isn't a syntax error on the 'procedure' line, however the syntax for the 'files' command is in the wrong format. It should be:

files ("*.fits", \$this->_split2($m[0]) output//"list_master")

The difference is between the "compute mode" syntax you would use on the command line, and the "program mode" syntax used in scripts. Even so, I couldn't find a way to execute the script, change the newlines, etc that produced the same error message you got.


Also if anyone could help me with the syntax for making the output list prefix a user defined variable, that'd be great!!


I don't understand the question -- the prefix is the task parameter 'output'. If you mean an environment variable, then to set the variable you would do:

cl\$this->_split2($m[0]) set foo = "bar"

and then in the script use it as something like

print ("variable foo is " // envget ("foo"))


 
Profile Email
 Quote
   
Content generated in: 0.09 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