realbasic-nug
[Top] [All Lists]

Re: Array.indexOf(value,startingIndex) has a gotcha!

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Array.indexOf(value,startingIndex) has a gotcha!
From: Will Leshner <will at haranbanjo dot com>
Date: Wed, 30 Nov 2005 16:41:59 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20051130194514 dot 26134EDC8E7 at lists dot realsoftware dot com> <p06210276bfb3ce64512e at [192 dot 168 dot 1 dot 4]>

On Nov 30, 2005, at 1:55 PM, Robert Woodhead wrote:

The workaround is yucky:

n = myArray.indexOf(dork)

while (n<>-1)

   dedorkify(myArray(n))

   if n<uBound(myArray) then n = myArray.indexOf(dork,n+1) else n=-1

wend

A much less yucky workaround would be to wrap the call in a try/catch.

--
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzLog: http://haranbanjo.com


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>