comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Compilation Error: Procedure header must appear first and onlyonce
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Compilation Error: Procedure header must appear first and onlyonce [message #76807 is a reply to message #76710] Wed, 29 June 2011 09:30 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/29/11 8:38 AM, Maegereg wrote:
> On 6/27/11 3:18PM, Michael Galloy wrote:
>> 1. Always check the first error in the file, a single syntax error can
>> cause many later error messages.
>>
>> 2. "Procedure header must appear first and only once" almost always
>> means you forgot to END something -- you have a BEGIN but no END for an
>> IF statement, a FOR loop, etc.
>
> I've checked the first error in each of the two files- both are syntax errors, and in both cases nothing actually appears wrong. Here's the two errors (error is on third line):
>
> END
> 'Funct_AIF_Fast': BEGIN
> SetTimeCommonBlock,tMargin=ObtainTMargin()+tMargin, tRange=tRange
> END
> 'Funct_Artery_AIF': BEGIN
>
> and
> t_time=*(*pState).pt_time
> time_courseC=(*(*pState).timecourse)[(*pState).cursorPositio n[0],(*pState).cursorPosition[1],*]
> uptake_curve=get_uptake_curve(time_courseC, pState, base_level=base_level)
> noise_Level=Calculate_Noise(time_courseC, (*pState).n_base, (*pState).baseStart, (*pState).n_Images-1) ;, df=df)
> ;save, uptake_curve, t_time, filename='D:\tmp.idl'
>
> Eclipse points out the )+ (of the tMargin=ObtainTMargin()+tMargin part), and the =b (of the base_level=base_level part). Neither of them seems to be a syntax error, though do correct me if I'm wrong. There are a ton more of these correct syntax errors scattered throughout the rest of the project.

These errors are usually indicative that you think you are calling a
function, but IDL thinks you are indexing an array. I would use
"compile_opt strictarr" at the beginning of each routine *and* only use
square brackets to index the array.

> I also checked the end statements for both of the files. I made a couple changes where it seemed like the wrong end had been used, but even now that the ends are completely correct, the errors persist. Another thing I did notice: eclipse is giving me errors of the form: "Type of end does not match statement" in the functions immediately before I start getting the procedure header errors. I've double checked these functions though, and the ends are correct. And I've also tried just blindly doing what the compiler says to make those bug reports go away (changing the ends to whatever it suggests, even if it's incorrect), but that didn't fix anything either.

I still think there is something screwed up there based on the
"Procedure header must appear first and only once", Carsten's suggestion
to remove a enough code for it to work and add back a little at a time
is good.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Upgrading to Windows 10
Next Topic: Moment and XROI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:24:58 PDT 2025

Total time taken to generate the page: 0.16216 seconds