... and it's "dangerous" if you want to user other value types than numbers. as an example, try put value( string( [1,2,3,QUOTE] ))
Valentin
I was going to mention this aspect too, but figured the performance difference was enough of a good enough reason.
Many people don't find out about list-to-string mutation until they write some big list out & then it doesn't come back as they expected - then they watch the process closely & see what is really going on.
-Buzz
Buzz Kettles wrote:While the below looks good, doing the 2 list-to-string conversions make that approach much slower than repeat-and-append.
hth -Buzz
At 4:09 PM +0200 4/11/05, you wrote:Hi Tim, maybe this could fit.... ---------------------------------------- list1 = [1,2,3,4] list2 = [5,6,7,8] --- s1 = string(list1) s2 = string(list2) --- res1 = s1.char[1..s1.length - 1] res2 = s2.char[2..s2.length] --- put value(res1 & "," & res2) -- [1, 2, 3, 4, 5, 6, 7, 8] ----------------------------------------
Dam
On Apr 11, 2005 3:16 PM, Valentin Schmidt <[EMAIL PROTECTED]> wrote:Hi Tim,
it won't help you in this situation, but in DMX2004 for javascript there is the concat() function for arrays:
var a = Array(1,2,3); var b = Array(4,5,6); trace(a.concat(b)); // 1,2,3,4,5,6
Valentin
Tim Welford wrote: > Hi, > > Thanks, that's similar to the method I am using at the moment. I was > hoping for some undocumented way of doing a simple join to get rid of > the repeat loop and hence improve the efficiency of the code. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ozkan > ALTUNER > Sent: 11 April 2005 13:15 > To: Lingo programming discussion list > Subject: Re: <lingo-l> joining lists in lingo > > Hello Tim, > > You can do it by appending list two to list one, by using a loop and > getAt(), getPropAt(), addProp() and addAt() methods. > > repeat with i = 1 to list2.count() > addProp(list1, getAt(list2, i) > end repeat > > i'm not exatcly sure of the syntax, however, it clearly should>>> give > you >>> > an idea. >>> > >>> > Ciao, >>> > Ozkan >>> > >>> > >>> > -----Orjinal mesaj----- >>> > From: "Tim Welford" [EMAIL PROTECTED] >>> > >>> > Date: Mon, 11 Apr 2005 14:28:10 +0300>>> the list, > email> > To: lingo-l@penworks.com > > Subject: <lingo-l> joining lists in lingo > > > >> Greetings List... > >> > >> I'm sure this is a daft question, but it escapes me. > >> Is there away of joining 2 lists together other than looping through> the >> second list and using .add to add it to the first list. >> >> i.e. >> list1 = [1,2,3,4] >> list2 = [5,6,7,8] >> >> list1 + list2 = [1,2,3,4,5,6,7,8] >> >> rather than a result of [6,8,10,12] >> or [1,2,3,4,[5,6,7,8]] >> >> This is just an example, I actually need to do it with a list of >> property lists, whilst the list is quite complicated, the format of > the >> 2 lists being joined will always be exactly the same, although the >> number of elements may change. >> >> Thanks >> >> Tim >> >> >> [To remove yourself from this list, or to change to digest mode, go >> to > http://www.penworks.com/lingo-l.cgi To post messages to the list, > email > lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). > Lingo-L is for learning and helping with programming Lingo. Thanks!] > > [To remove yourself from this list, or to change to digest mode, go to > http://www.penworks.com/lingo-l.cgi To post messages to> lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). > Lingo-L is for learning and helping with programming Lingo. Thanks!] > > > > [To remove yourself from this list, or to change to digest mode, go > to http://www.penworks.com/lingo-l.cgi To post messages to the list, > email lingo-l@penworks.com (Problems, email > [EMAIL PROTECTED]). Lingo-L is for learning and helping with > programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email lingo-l@penworks.com (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]