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

Home » Public Forums » archive » Re: Dumb problem with STRPOS
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Dumb problem with STRPOS [message #4731] Mon, 17 July 1995 00:00
larkum is currently offline  larkum
Messages: 21
Registered: May 1993
Junior Member
In article usi@ds2.acs.ucalgary.ca, steele@aragorn.phys.ucalgary.ca (Dave Steele) writes:
> Can someone explain the following behaviour to me?
>
> IDL> help,/st,!version ; Here's the situation.
> ** Structure !VERSION, 3 tags, length=24:
> ARCH STRING 'mipseb'
> OS STRING 'RISC/os'
> RELEASE STRING '3.1.0'
> IDL> test='c000.' ; define a string
> IDL> help,test ; check it is a string
> TEST STRING = 'c000.'
> IDL> print,strpos(test,'000') ; search for a substring
> 1
> IDL> print,strpos(test,'000.') ; and a slightly different one
> 1
> IDL> test='c0000.' ; add a '0'
> IDL> help,test
> TEST STRING = 'c0000.'
> IDL> print,strpos(test,'000') ; search again
> 1
> IDL> print,strpos(test,'000.') ; Why isn't this substring found???
> -1
>
> I checked the manual for this version and it says nothing that would
> explain this. BTW, it's nothing to do with octal constants.
>
> All suggestions gratefully received!
>
> Dave

Well, this bug goes back to the original code because it's in
the latest version of PV-Wave as well:

WAVE> info,/st,!version
** Structure !VERSION, 4 tags, 32 length:
ARCH STRING 'sparc'
OS STRING 'sunos'
RELEASE STRING '4.20'
PLATFORM STRING 'sun4'
WAVE> test='c000.'
WAVE> info, test
TEST STRING = 'c000.'
WAVE> print,strpos(test,'000')
1
WAVE> print,strpos(test,'000.')
1
WAVE> print,strpos(test,'000.')
1
WAVE> test='c0000.'
WAVE> info, test
TEST STRING = 'c0000.'
WAVE> print,strpos(test,'000')
1
WAVE> print,strpos(test,'000.')
-1

Sorry, I can't bring any joy for PV-Wave users either.

Matthew
____________________________________________________________ ______________
Matthew Larkum
Physiologisches Institut
Buehlplatz 5, CH-3012 Bern Switzerland
Ph. 41 31 631 8726 Fax. 41 31 631 4611
Internet: larkum@pyl.unibe.ch
matthewl@cortex.physiol.su.OZ.AU
Re: Dumb problem with STRPOS [message #4735 is a reply to message #4731] Sat, 15 July 1995 00:00 Go to previous message
Paul Probert is currently offline  Paul Probert
Messages: 7
Registered: May 1995
Junior Member
David,

Nice bug! Also does it on VAX VMS 3.6.1c.
IDL: Robust system, NOT!

Paul Probert
University of Wisconsin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Errors in continental outlines
Next Topic: Mac Quicktime movie importing....

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

Current Time: Wed Oct 08 13:44:50 PDT 2025

Total time taken to generate the page: 0.00603 seconds