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

Home » Public Forums » archive » programmatically compile a procedure without a .pro extension
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: programmatically compile a procedure without a .pro extension [message #85667 is a reply to message #85663] Sun, 25 August 2013 20:23 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Heinz,

Thanks. That is an elegant use of CATCH.

I still have mild trepidation about requiring an arbitrary user to have write access to a disk. But I've never had any problem using IDL_TMPDIR as a scratch writeable directory, so I should probably
stop worrying. --Wayne

On Sunday, August 25, 2013 8:10:37 AM UTC-4, Heinz Stege wrote:
> If you don't want to get a .pro file by renaming (or making a copy of)
>
> the .bak file, you can do something like the following. The routine
>
> below creates a temporary .pro file and includes the files with other
>
> extensions by use of the @ include file character:
>
>
>
> pro compile,filenames
>
> ;
>
> tempfile='compile_temp'
>
> openw,lun,/get_lun,tempfile+'.pro'
>
> printf,lun,'@'+filenames,form='(a)'
>
> free_lun,lun
>
> ;
>
> catch,error
>
> if ~error then resolve_routine,tempfile
>
> catch,/cancel
>
> ;
>
> end
>
>
>
> The catch statement suppresses an error message from the compiler,
>
> that there is no compile_temp routine.
>
>
>
> Note that you can specify the filenames by a string array, if you want
>
> to compile more than one file.
>
>
>
> Cheers, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Does Java polymorphism not work via the IDL Java Bridge?
Next Topic: x/y margin from map_set to plot position and cgimage

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

Current Time: Wed Oct 29 11:07:19 PDT 2025

Total time taken to generate the page: 0.03702 seconds