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

Home » Public Forums » archive » Re: compiling before needing
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: compiling before needing [message #26597 is a reply to message #26592] Wed, 12 September 2001 14:54 Go to previous messageGo to previous message
Todd Clements is currently offline  Todd Clements
Messages: 23
Registered: January 2001
Junior Member
> My programm consists of several functions and procedures in
> corresponding files. Is there a way of automatically compiling all files
> (functions/procedures) before they are needed

Reimar is right - just stick a resolve_all at the beginning of the
function that is called, and IDL will resolve all routines.

I've also written a routine that will do this much, much more manually
(which isn't what you wanted, but I thought I'd share anyway). It will
let you check if a routine is compiled and you can optionally force it
to compile. The /compile keyword will compile it if it's not already
compiled, and the /force_compile keyword will compile it even if it's
already compiled. The function returns 1 if the routine is compiled and
0 if it is not.

Todd

;-----------------------

function is_routine_compiled, routineName, compile=compile,$
force_compile=force_compile
compile_opt idl2

if( typeof( routineName ) ne 7 ) then begin
print, 'Must pass string to is_routine_compiled'
return, 0
endif

rn = strupcase( routineName )

a = routine_info()
a = [a, routine_info(/functions)]
junk = where( a eq rn )
if( junk[0] ne -1 ) then begin
;; We may have found it, but it may not be resolved
a = routine_info(/unresolved)
a = [a, routine_info( /unresolved, /functions )]
junk = where( a eq rn )
if( junk[0] ne -1 ) then junk = -1 else junk = 1
endif

if( junk[0] eq -1 or keyword_set(force_compile) ) then begin
if( keyword_set( compile ) or $
keyword_set( force_compile )) then begin
resolve_routine, rn, /compile_full_file, /either
return, is_routine_compiled(rn)
endif else return, 0
endif else return, 1
end ;;is_routine_compiled
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calling LAPACK from IDL
Next Topic: previous and last

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

Current Time: Sun Oct 12 14:51:00 PDT 2025

Total time taken to generate the page: 0.88334 seconds