Error while using scan() in the procedure script
smp wrote on May 06, 2009
Hi,
This is segment of my script:
If run the script, I get following error:
Please tell what is wrong in the script?
Regards
smp
This is segment of my script:
procedure new (object_filename,flat_filename)
string object_filename {prompt = "Give name of file containing science images"}
string flat_filename {prompt = "Give name of file containing flat images"}
:
struct *imglist
begin
string imname
:
:
imgfile = mktemp("tmp$HD80606_B_")
sections(obj_file, option = "fullname", > imgfile)
imglist = imgfile
while(fscan(imglist,imname) != EOF)
{
printf(imname//"_left") | scan(str)
imcopy(input = imname//"[1:1084,*]", output = str, verbose = no)
:
:
}
If run the script, I get following error:
ERROR: scan limited to 1022 char lines
scan (new.str)
new ()
Please tell what is wrong in the script?
Regards
smp
Mike Fitzpatrick wrote on May 06, 2009
The scan() wants to see a newline: either use print() instead or else put a "\n" at the end of the string.
-Mike
-Mike
smp wrote on May 06, 2009
I tried
But then I got the error:
print(imname//"_left") | scan(str)But then I got the error:
ERROR on line 147: Attempt to access undefined local variable `str'
Mike Fitzpatrick wrote on May 06, 2009
That message usually means the scan to the variable failed, i.e. either the fscan() in the loop didn't read anything into 'imname', or you're running something like "foo() | scan(str)" but the foo() didn't produce any output so the scan didn't load 'str' and you later tried to use it.
-Mike
-Mike
smp wrote on May 06, 2009
thanks
it worked
regards
it worked
regards
Last post on May 06, 2009