to find the first numeric line?
dunbarx at aol.com
dunbarx at aol.com
Thu Jan 31 12:56:08 EST 2013
Hi.
If you sort your alphanumeric list, you will, of course, already know that the alphas sort before the digits, so the first digit will be down a bit.
But how long is that list? After sorting, if you loop through using the "repeat for each..." variant and exit accordingly, I cannot imagine that it would take more than an instant to find the first digital char. Old fashioned but trusty.
I have done binary searches, splitting data in halves as you go so that you cut down processing time, mainly finding stuff in long HC datasets.
Craig Newman
-----Original Message-----
From: Tiemo Hollmann TB <toolbook at kestner.de>
To: 'How to use LiveCode' <use-livecode at lists.runrev.com>
Sent: Thu, Jan 31, 2013 11:54 am
Subject: to find the first numeric line?
Hello,
I have a list with alphanumeric and numeric content. After sorting numeric I
would like to find the first line with a numeric first char. (the non
numeric lines before can contain also numeric chars). I would like to have a
kind of lineoffset(isNumber(first char.),list,), but that's not prebuilt.
What would be the fastest or most straight forward way to look up such a
list? Just looping through? Testing the first char every half of the list in
a loop? Or is there a function I don't think of?
Thanks for any pointers
Tiemo
_______________________________________________
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