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

Home » Public Forums » archive » Re: An IDL STRTOK??? Was: TextoIDL Broken and Gone?
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: An IDL STRTOK??? Was: TextoIDL Broken and Gone? [message #23349 is a reply to message #23310] Mon, 15 January 2001 15:13 Go to previous messageGo to previous message
landsman is currently offline  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/
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: An IDL STRTOK??? Was: TextoIDL Broken and Gone?
Next Topic: Re: Merging Bytarr

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

Current Time: Sun Oct 12 02:28:41 PDT 2025

Total time taken to generate the page: 0.55951 seconds