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

Home » Public Forums » archive » Re: str_sep bug
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: str_sep bug [message #7520 is a reply to message #7501] Mon, 25 November 1996 00:00 Go to previous message
Phil Williams is currently offline  Phil Williams
Messages: 78
Registered: April 1996
Member
Sorry to answer my own question. BUT, after posting I searched the
str_sep routine and think I located the bug. It's at line 122 of
str_sep.pro. The line reads:

else arr(i) = strmid(s, spos < strlen(spos) - 1, strlen(s))

but should read:

else arr(i) = strmid(s, spos-strlen(sep), strlen(s))

I still think that there is a "bug." Although some would call it a
feature? It's that the last element in the seperated list still has the
seperator attached.

Hope this helps,
Phil

Phil Williams wrote:
>
> I think that I have found a bug in the str_sep.pro function. Observe
> the following:
>
> IDL> t = 'apples, oranges, peaches'
> IDL> print,str_sep(t,',')
> apples oranges , peaches
> IDL> print,str_sep(t,', ')
> apples oranges nges, peaches
>
> It appears that the last element is messed up when you add the space to
> the separator it fails on the last element.
>
> Any help would be appreciated.
>
> Phil
> --
> /*********************************************************** ********/
> Phil Williams, Ph.D.
> Research Instructor
> Children's Hospital Medical Center "One man gathers what
> Imaging Research Center another man spills..."
> 3333 Burnet Ave. -The Grateful Dead
> Cincinnati, OH 45229
> email: williams@irc.chmcc.org
> URL: http://scuttle.chmcc.org/~williams/
> /*********************************************************** ********/

--
/*********************************************************** ********/
Phil Williams, Ph.D.
Research Instructor
Children's Hospital Medical Center "One man gathers what
Imaging Research Center another man spills..."
3333 Burnet Ave. -The Grateful Dead
Cincinnati, OH 45229
email: williams@irc.chmcc.org
URL: http://scuttle.chmcc.org/~williams/
/*********************************************************** ********/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Inters. of two planes: routine wanted
Next Topic: Re: Make money!

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

Current Time: Sat Oct 11 17:21:07 PDT 2025

Total time taken to generate the page: 0.00242 seconds