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

Home » Public Forums » archive » David: for your book ?
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: David: for your book ? [message #21322 is a reply to message #21233] Tue, 15 August 2000 00:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Martin Schultz <martin.schultz@dkrz.de> writes:
> As an aside, I recently found another problem in terms of backward
> compability (I am
> sure something similar was already mentioned in this newsgroup, but this
> was the first
> time I had this problem):
> I tried to write a routine that takes advantage of the new StrMatch
> and StRegex
> functions in 5.3. In order to ensure backward compatibility, I enclosed
> these function calls
> with
> IF !Version.Release GE 5.3 THEN BEGIN
> ENDIF
>
> However, a colleague tells me: no chance! The program will report a
> syntax error when run in
> IDL 5.2! So, the problem is that IDL looks for a function of this name
> during compile stage
> and doesn't care if it will ever be used.
...

There is a way to do this without defining an external function, by
using FORWARD_FUNCTION properly:

FORWARD_FUNCTION stregex, strmatch
IF !Version.Release GE 5.3 THEN BEGIN
foo = stregex(bar)
sm = strmatch(eg)
ENDIF

This will make sure that IDL will always recognize strmatch & stregex
as functions during the compilation stage, and there will be no syntax
errors in any IDL version. It is harmless in IDL 5.3. If you really
want the warning message, then by all means go ahead and make your own
strmatch definitions et al.

Have fun,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Passing function to function called by qromb etc.?
Next Topic: Passing function to function called by qromb etc.?

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

Current Time: Tue Dec 02 17:44:31 PST 2025

Total time taken to generate the page: 0.39970 seconds