common code patterns

Mark Wieder ahsoftware at sonic.net
Fri Aug 11 12:27:24 EDT 2017


On 08/11/2017 08:42 AM, Alex Tweedly via use-livecode wrote:

> Is it really worth doing this by changing each of the lines ?
> Is it not easier, clearer and very likely just as fast, to do:
> 
>> put empty into tNewBreaks
>> repeat for each line tBreak in tBreaks
>>   put item 1 of tBreak into tID
>>   put the long id of control id tID of the topstack into tObjectID
>>   put tObjectID & the itemDel & item 2 to -1 of tBreak &CR after 
>> tNewBreaks
>> end repeat
>> return char 1 to -1 of tNewBreaks 
> With a bonus that deleting lines (i.e. not copying them) is easier.

It is indeed. Thanks.
Refactoring... er... moomin... FTW.

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list