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
Errors when compiling routines with main-level programs [message #90332] Sat, 21 February 2015 07:53 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
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: Wed Oct 08 15:37:51 PDT 2025

Total time taken to generate the page: 0.00432 seconds