Welcome to iraf.net Friday, May 10 2024 @ 07:13 PM GMT
sakenjm |
05/31/2007 02:45PM (Read 2965 times)
|
|
|
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
|
|
|
|
fitz |
05/31/2007 02:45PM
|
|
|
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
|
|
|
|
| |
|
Content generated in: 0.10 seconds |
|