Ordering text

Tore Nilsen tore.nilsen at me.com
Sun Mar 29 07:15:36 EDT 2020


I believe the reason for the delay comes from the fact that when sorted descending, you put tRec & CR before tCellData. Tp put something before a container is slower than putting something after a container.

Regards
Tore Nilsen

> 29. mar. 2020 kl. 13:06 skrev Terence Heaford via use-livecode <use-livecode at lists.runrev.com>:
> 
> I have approx. 7000 lines of tab delimited data.
> 
> When I execute the code snippet below if the sort order is descending it takes approx 120 milliseconds otherwise it takes 20 milliseconds to process.
> 
> Can someone explain why and perhaps come up with a faster solution.
> 
> Thanks
> 
> Terry
> ——————————
> 
> repeat for each line tRec in tData
> 
> add item 6 of tRec to tBalance
> 
> put tBalance into item 7 of tRec
> 
> 
> switch tOrder
> 
> case "desc"
> 
> put tRec & CR before tCellData
> 
> break
> 
> default
> 
> put tRec & CR after tCellData
> 
> end switch
> 
> 
> end repeat
> 
> 
> switch tOrder
> 
> case "desc"
> 
> delete char 1 of tCellData
> 
> break
> 
> default
> 
> delete last char of tCellData
> 
> end switch
> 
> -------------------
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list