Re: Need someone very familiar with arrays
- From: "rialto" <noname@xxxxxxxxxx>
- Date: Sun, 11 Nov 2007 08:46:28 -0800
"Steve Gerrard" <mynamehere@xxxxxxxxxxx> wrote in message news:QqKdneSs8oco1KvanZ2dnUVZ_vWtnZ2d@xxxxxxxxxxxxxx
Larry is like "a black hole". Even the most obscure details can't escape him. A sharp mind.
"rialto" <noname@xxxxxxxxxx> wrote in message news:ez4amv9IIHA.1316@xxxxxxxxxxxxxxxxxxxxxxx"Robert Morley" <rmorley@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:utZE3e2IIHA.5468@xxxxxxxxxxxxxxxxxxxxxxx
You got a bug. If non-zero elements are moved, then you must assign a zero to where those elements were moved from or the interior start loop will not know when to stop. It would in effect move until it reached the last non zero item in the list and then write that value repeatedly whenever a zero was encountered.
start would continue to increment, yes, but it would not do any more writing, since you have
If start < finish Then
a(start) = a(finish)
so the incrementing is harmless.
Because the loop "does" know where to stop, you don't need the start < finish checks in the interior loops.
As Larry pointed out, you do to avoid running off the end. Once you put the test in, then start will never increment past finish, so there is never any concern for what lies higher up than finish. Ergo, no setting to 0 is needed.
.
- References:
- RE: Need someone very familiar with arrays
- From: KeetClassic
- Re: Need someone very familiar with arrays
- From: Mike Williams
- Re: Need someone very familiar with arrays
- From: rialto
- Re: Need someone very familiar with arrays
- From: rialto
- Re: Need someone very familiar with arrays
- From: Robert Morley
- Re: Need someone very familiar with arrays
- From: rialto
- Re: Need someone very familiar with arrays
- From: Steve Gerrard
- RE: Need someone very familiar with arrays
- Prev by Date: Re: Female Professional Web Designer Required
- Next by Date: Re: Need someone very familiar with arrays
- Previous by thread: Re: Need someone very familiar with arrays
- Next by thread: Re: Need someone very familiar with arrays
- Index(es):
Relevant Pages
|