|
Re: An IDL STRTOK??? Was: TextoIDL Broken and Gone? [message #23349 is a reply to message #23310] |
Mon, 15 January 2001 15:13  |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
A couple of historical notes on strtok and textoidl:
1. In the V5.3 beta distibution, there was an intrinsic routine STRSPLIT
to split a string into substrings. But this caused conflict with a
user procedure strsplit.pro in a widely-distributed large IDL package.
So RSI attempted to avoid this conflict by renaming the intrinsic
procedure STRTOK and making STRSPLIT a procedure that simply called
STRTOK (so that the user procedure strsplit.pro could be given
precedence in the !PATH if desired). Unfortunately, this now caused a
conflict with the procedure strtok.pro in the widely distributed
textoidl package.
2. There is a duplicate version of the textoidl package at
http://astro.uni-tuebingen.de/software/idl/textoidl/index.ht ml
but this has the same strtok compatibility problem for V5.3 and later.
As Mirko mentioned, one simply has to rename strtok.pro and the calls to
strtok in Translate_Sub_Super.pro
Changing subjects, one recent change I've discovered going from V5.3 to
V5.4 that I'm not sure has been mentioned yet, is that one can no longer
read past the end of a file with ASSOC. Below is a simple test
program that tries to read 20 bytes from a 10 byte file. In V5.3 the
extra 10 bytes are padded with zeros, while in V5.4 there is an error.
I think I prefer the V5.4 behaviour so this is arguably a bug fix.
Still, I had to fix up some older code in order to get it to work under
V5.4.
--Wayne Landsman landsman@mpb.gsfc.nasa.gov
pro test
openw,lun,'test.dat',/get_lun
writeu,lun,bindgen(10) ;Write 10 bytes
close,lun & openr,lun,'test.dat' ;Close the file & open for
reading
a = assoc(lun,bytarr(20) ) ;Associate with a 20 byte array
print,a(0)
free_lun,lun
return
end
STIS>print,!VERSION
{ sparc sunos unix 5.3 Nov 11 1999}
STIS>test
0 1 2 3 4 5 6 7 8 9 0 0 0 0 0 0 0
0 0 0
IDL> print,!VERSION
{ sparc sunos unix 5.4 Sep 25 2000 32 64}
IDL> test
% End of file encountered. Unit: 113, File: test.dat
% Execution halted at: TEST 8
/stis0/data31/landsman/iraf/test.pro
% $MAIN$
Sent via Deja.com
http://www.deja.com/
|
|
|
Re: An IDL STRTOK??? Was: TextoIDL Broken and Gone? [message #23351 is a reply to message #23349] |
Mon, 15 January 2001 14:04  |
Mirko Vukovic
Messages: 124 Registered: January 1996
|
Senior Member |
|
|
In article <onbst8eczg.fsf@cow.physics.wisc.edu>,
craigmnet@cow.physics.wisc.edu wrote:
>
> davidf@dfanning.com (David Fanning) writes:
>> Nick Bower (bowern@ses.curtin.edu.au) writes:
>>
>>> This really sucks and it's most unfortunate that such a well-known
>>> package like this has been inadvertently clobbered without a hint
of
>>> documentation.
>>
To fix the thing on my machine, I had to do the following:
1) rename the file strtok.pro and the function name in it (I chose
StrUpToTok).
2) In file Translate_Sub_Super.pro change calls to StrTok to (in my
case) StrUpToTok on lines 227-x and 292-x (where - stands for ``minus''
and x is about 5 -- I actually increased the length of the file by
documenting the change :-))
But as Craig? pointed out, one may not be able to distribute the file
due to copyright issues.
Now, a bit off topic, where does one find the post-script codes for the
symbols, in case one extends the translation table?
Mirko
Sent via Deja.com
http://www.deja.com/
|
|
|