Welcome to iraf.net Friday, May 10 2024 @ 07:13 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Could somonew explain this script's behavior?
   
sakenjm
 05/31/2007 02:45PM (Read 2965 times)  
+----
Newbie

Status: offline


Registered: 05/16/2007
Posts: 8
Hi,I don't understand what is wrong here. Here's a simple script:procedure foo(aa)
string aa="Testing" {prompt = "Does this work "}
print ("var= ",aa)
begin
string laa=""
laa=aa
print ("lvar=",laa)
endHere's what happens when I run it:cl> task $foo=foo.cl
cl> foo
lvar=
cl> logoutAnd when I try it slightly differently:cl> task foo=foo.cl
cl> foo
**: print ("var= ",aa)
^
ERROR: syntax error, line 3I would greatly appreciate it if someone could explain what I'm doing wrong here.Thanks.jon

 
Profile Email
 Quote
fitz
 05/31/2007 02:45PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Declaring a task as e.g. "$foo" has the '$' tell the CL the task has no parameters and so the 'aa' param isn't seen. Where I'm confused is why the print() statement didn't trigger a sytax error in both cases -- the only thing allowed between the 'procedure' and 'begin' statement should be variable/parameter declarations.-Mike

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