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

Home » Public Forums » archive » Re: idl syntax validation
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: idl syntax validation [message #50718 is a reply to message #50671] Wed, 11 October 2006 18:29 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 11 Oct 2006 15:11:05 -0700, Dometz wrote:

> I guess I wasnt clear enough... I mean something that I can run in a
> bash script to test if a .pro file has valid syntax.
>
> something like:
> echo '.compile foo.pro' | idl
> and then checking if there are any syntax error messages and if there
> are act accordingly.
>
> But is there a better way than using .compile for this?

I guess I didn't do all your homework for you ;). You could use this
idea to write a function called check_syntax, ala:

function check_syntax,routine
catch,err
if err ne 0 then return,err
resolve_routine,routine,/EITHER,/COMPILE_FULL_FILE
return,0
end

Then a batch file which uses this function, like do_check.pro:

;================
status=check_syntax((command_line_args())[0])
if status ne 0 then print,!ERROR_STATE.MSG
exit,STATUS=status
;================

then call, from your shell script:

idl -arg routine do_check.pro

and check the exit status. You might need to monkey IDL_PATH to ensure
it attempts to compile the correct version of the routine, like:

idl -IDL_PATH "$(pwd):+/other/libs:<IDL_DEFAULT>" -arg routine do_check.pro

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Opening a .isv file
Next Topic: Basic format code question

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

Current Time: Wed Oct 08 20:14:07 PDT 2025

Total time taken to generate the page: 0.00587 seconds