using "repeat for each" when you don't want to start with
thefirst line
Ray Horsley
ray at linkitonline.com
Mon Apr 29 16:11:01 EDT 2002
on 4/29/02 11:31 AM, Rich Mooney at tech at paynesparkman.com wrote:
> I've had the same problem and worked around it by looking for
> CurScene&return rather than just CurScene. I think your solution is better.
> Thanks.
>
> Rich Mooney
> Payne Sparkman Mfg.
> tech at paynesparkman.com
>
> ----- Original Message -----
> From: "Ray Horsley" <ray at linkitonline.com>
> To: <metacard at lists.runrev.com>
> Sent: Monday, April 29, 2002 4:08 PM
> Subject: Re: using "repeat for each" when you don't want to start with
> thefirst line
>
>> I have a number of repeat loops in my software which I would love to speed
>> up using the "repeat for each" technique but I don't want to start with
> the
>> first line. Instead, I want to start based on which line the user selects
>> in a fld. A typical example of what I'm currently doing follows:
>>
>> put the SelectedText of fld "Scene List" into CurScene
>> put lineoffset(CurScene&return,SceneFile) into q
>> repeat with q2 = q+1 to the number of lines in SceneFile
>> do stuff
>> end repeat
>>
>> Any suggestions?
>>
>>
>> As a side note, should you be setting the WholeMatches to true before
> using
>> the lineOffset function? I got caught on this one. If I don't set the
>> WholeMatches to true lineOffset will find matches within lines.
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
I think setting WholeMatches to true is better also. I haven't tested this,
but you might find problems using the return char if lineOffset finds a
partial match which also happens to be at the end of a line.
You should also consider using "is among". I don't think this is dependent
on WholeMatches, and I believe it always tests entire lines.
Ray Horsley
LinkIt! Software
More information about the metacard
mailing list