Split, combine ok but where's extract?
b.xavier at internet.lu
Sat Feb 12 18:29:06 CST 2005
Just sweet! I'll test it monday (or before) on my 2k lines tables ;)
Surely will be shocking and you'll be famous!
> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
> David Vaughan
> Sent: Sunday, February 13, 2005 00:46
> To: use-revolution at lists.runrev.com
> Subject: Re: Split, combine ok but where's extract?
> Moron me! Doing some edits from my test script I omitted the line "add
> 1 to i" just before " end repeat"
> On 13/02/2005, at 10:43, David Vaughan wrote:
> > Xavier
> > This is the merge part
> > Assume you have the following two variables:
> > v1 contains "a"
> > v2 contains "b"
> > split v2 with return
> > put 1 into i
> > repeat for each line x in v1
> > put v2[i] into myArray[x]
> > end repeat
> > combine myArray with return and comma
> > myArray is now a list whose first line is "a,b"
> > This code avoids any "repeat with i = 1 to n" loops and is
> thus fairly
> > linear in time taken with longer lists.
> > Incidentally, I left "with return" off a couple of lines in the
> > previous extract code.
> > I have not done any speed tests.
> > Hope this is relevant.
> > regards
> > David
> use-revolution mailing list
> use-revolution at lists.runrev.com
More information about the use-livecode