common code patterns

Monte Goulding monte at appisle.net
Thu Aug 10 16:39:21 EDT 2017


> On 11 Aug 2017, at 6:20 am, Mark Wieder via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> On 08/10/2017 10:38 AM, Ralph DiMola via use-livecode wrote:
>> To make this even more flexible:
>> repeat for each line tLine in tLines with [counter] tIndex [start] [{1}|x]
>> [step] [{1}|y]
>>  end repeat
> 
> I would change the syntax slightly:
> 
> repeat for each line tLine in tLines [using tIndex [start [to end]]]
> end repeat
> 
> but otherwise +1: I end up writing loops like this a lot.

Sorry folks I should have been more specific and said using existing syntax. So the original thing posted is what I’m after at the moment:

local tIndex
put 1 into tIndex
repeat for each line tLine in tLines
   — code
   add 1 to tIndex
end repeat

Jacque the break thing is possible but not what I’m after at the moment. Could you open an enhancement request and I’ll try and get that done for you.

Cheers

Monte



More information about the use-livecode mailing list