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 #21324 is a reply to message #21233] Tue, 15 August 2000 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Craig Markwardt wrote:
>
> Martin Schultz <martin.schultz@dkrz.de> writes:
>> Hi,
>>
>> Testing IDL's capabilities is always dangerous: you might get more
>> than you ask for!
>>
>> What would you expect to get out of the following:
>>
>> test = [ 'dir1/', 'directory2/', 'another_directory/' ]
>> print,strmid(test,0,strlen(test)-1)
>
> Hmm, I got an error message!
>
> IDL> test = [ 'dir1/', 'directory2/', 'another_directory/' ]
> IDL> print,strmid(test,0,strlen(test)-1)
> % STRMID: Expression must be a scalar in this context: <LONG Array>.
> % Execution halted at: $MAIN$
>
> IDL> print, !version
> { alpha OSF unix 5.2 Oct 30 1998}
>
> Is this something new in IDL 5.3?
>

Apparently so! What I get as a result is a 3x3 matrix containing in the
first column
all directory namews truncated to a length of 4, in the second column
10, and in the
third column StrLen(test[2]-1). But I am glad you point this out.

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. Only help is to write two
little dummy functions
named stregex.pro and strmatch.pro which do nothing but print a warning
message. And so I
did. Works nicely, and you don't even have to test for the release
number because these two
functions are internal in 5.3 and hence they are discovered before
anything on disk can be
found.


Just a little bedtime story ;-)

Cheers,
Martin



--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Dr. Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 41173-298 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[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 18:21:15 PST 2025

Total time taken to generate the page: 0.88502 seconds