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

Home » Public Forums » archive » Re: strpos
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: strpos [message #56729 is a reply to message #56726] Fri, 09 November 2007 05:43 Go to previous messageGo to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Nov 9, 1:39 pm, Spon <christoph.b...@gmail.com> wrote:
> On Nov 9, 1:01 pm, "ben.bighair" <ben.bigh...@gmail.com> wrote:
>
>> On Nov 9, 5:24 am, greg.a...@googlemail.com wrote:
>> p2 = STRARR(N_ELEMENTS(res))
>> for i= 0L, nRes-1 do p2[i] = STRPOS(res[i], '.', p1[i])
>
> I posted this workaround and then ate it, as it was buggy when I ran
> it through a second set of strings. I still believe working around the
> problem using STREGEX and its LENGTH variable (to give you two points
> in the string) should work in principle, but my code is buggy. Sorry.
>
> RegEx = '\\[^\\]*\.'
> StrLen = STRLEN (Res)
> ExRes = STREGEX (Res, RegEx, LENGTH = Len)
> p1 = StrLen - ExRes
> p2 = StrLen - ExRes - Len
>
> Maybe someone smarter than me can work out why my p2 values are
> occasionally out by 1, occasionally not.
>
> Sorry it's only a partial solution,
> Chris

Eep, I'm using a function name as a variable! Change StrLen to
StrLength to get rid of at least one confounding factor :-)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to use customized Hershey fonts?
Next Topic: IDL on windows server 2003

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

Current Time: Sat Oct 11 13:09:25 PDT 2025

Total time taken to generate the page: 1.36457 seconds