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

Home » Public Forums » archive » Errors when compiling routines with main-level programs
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: Errors when compiling routines with main-level programs [message #90333 is a reply to message #90332] Sat, 21 February 2015 11:52 Go to previous messageGo to previous message
PMan is currently offline  PMan
Messages: 61
Registered: January 2011
Member
Look into the STATIC keyword - you can create an object that has a bunch of static functions that should address your problem.

On Saturday, February 21, 2015 at 10:53:12 AM UTC-5, Matthew Argall wrote:
> I have adopted the practice of putting main-level programs below utility functions to demonstrate their use. The problem is, only one such routine can be compiled manually at a time, and it must come at the end of the compile list. It can get pretty annoying. Here is a simple example:
>
> IDL> .compile uniq, mruniq
> % Compiled module: UNIQ.
> % Compiled module: MRUNIQ.
> % Compiled module: $MAIN$.
>
>
> IDL> .compile mruniq, uniq
> % Compiled module: MRUNIQ.
> % Compiled module: $MAIN$.
> % End of file encountered before end of program. File: mruniq.pro
>
> function UNIQ, ARRAY, IDX
> ^
> % Procedure header must appear first and only once: UNIQ
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 68
>
> if (s[0] eq 0) then return, 0 ;A scalar
> ^
> % Return statement in procedures can't have values.
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 73
>
> else return, n_elements(q)-1
> ^
> % Return statement in procedures can't have values.
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 78
>
> else return, n_elements(q)-1
> ^
> % Return statement in procedures can't have values.
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 78
>
> else return, n_elements(ARRAY)-1
> ^
> % Return statement in procedures can't have values.
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 82
>
> else return, n_elements(ARRAY)-1
> ^
> % Return statement in procedures can't have values.
> At: /Applications/exelis/idl82/lib/uniq.pro, Line 82
> % 6 Compilation error(s) in module $MAIN$.
>
>
>
>
> Is there a fix for this? Or should I not be putting main-level programs at the end of functions and procedures?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Direction of Wind Vectors: A bug?
Next Topic: Fortran Namelist Parser

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

Current Time: Sat Oct 11 23:05:21 PDT 2025

Total time taken to generate the page: 0.72066 seconds