[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Which like command for IDL?
"Pavel A. Romashkin" wrote:
>
> Oh, STRTOK has been around for a while. Any illegal call to STRSPLIT (my
> common one, passing an array as a parameter) would crash it and expose a
> call to STRTOK. I think I even asked a question about it (long time
> ago), but I can't remember what kind of answer did I get. A real IDL
> hacker (like Craig) probably would know.
> Cheers,
> Pavel
>
> David Fanning wrote:
> >
> > David Fanning (davidf@dfanning.com) writes:
> >
> > > It is a moot point anyway, in this case, since the program
> > > uses some of the neat new SWITCH, BREAK, etc. stuff that
> > > comes in IDL 5.4, and will not compile in earlier versions.
> >
> > Interestingly, the FILE_WHICH program supplied in IDL 5.4
> > calls a built-in, but undocumented, program STRTOK, which
> > appears to separate the path subdirectories based on
> > a delimiter supplied to the function. I'll leave it
> > to the expert sleuths in the group to tell us what it
> > *really* does. :-)
from /usr/local/rsi/idl/lib/strsplit.pro:
; NAME:
; STRSPLIT
;
; PURPOSE:
; Wrapper on the build in system routine STRTOK that implements
exactly
; the same interface as STRTOK, but with the STRSPLIT name.
;
; The reason for doing this is so that if a user has their own
; STRSPLIT in their local user library, their version will
superceed
; this one. RSI does not recommend this practice, but it is
; allowed for backwards compatability reasons. See the
; documentation for STRSPLIT in the IDL Reference manual
; for details on arguments, keywords, and results.
;
The lesson for the day has been: built-ins cannot be overridden, unless
RSI sets up a silly hack such as this to allow you to.
JD