Faster way to get tabStops?

BNig bernd.niggemann at uni-wh.de
Thu Feb 19 12:45:07 CET 2015


Thanks Mike,

you can load the field with 5000 lines worth of data via the Helper stack ->
Examples -> choose 5000 -> click button "fill with n lines of random data",
then move the lines by moving the dividers and then control-click into the
field.
This triggers the recalculation of the column widths via
"mtfAdjustToWidthOfContent"

It is quite fast.

Kind regards
Bernd


Mike Bonner wrote
> Wow. Nice Bernd.
> 
> On Thu, Feb 19, 2015 at 1:47 AM, BNig <

> bernd.niggemann@

> > wrote:
> 
>> Hi Dan,
>>
>> I ran into the same problem and figured that acessing the field and ask
>> for
>> formattedWidth is slow.
>>
>> So I tried to minimize that.
>>
>> I took each tab delimited item an stuffed it into an array. For each
>> column
>> one key.
>>
>> You end up with each key holding the data of one column worth of data
>>
>> Then I put that column into a field that has the same properties as the
>> original field and get the formattedWidth. This tells me the space I need
>> to
>> set the tabstops.
>>
>> That way I only access the field column times. This speeds up the whole
>> process tremendously.
>>
>>
>>
>> To see it in action you can have a look:
>> ---------------------------
>>
>> http://runtime-revolution.278305.n4.nabble.com/ANN-modified-Table-Field-0-2-9-td4683338.html#a4683384
>> --------------------------
>> watch for line breaks.
>>
>> look at the script of field "fData" handler mtfAdjustToWidthOfContent.
>>
>> Kind regards
>>
>> Bernd





--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Faster-way-to-get-tabStops-tp4689049p4689067.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list