No native functions, but you could easily create one.

<cfscript>
function ArrayJoin(a, b) {
  var i = 1;
  for (; i lte ArrayLen(b); i=i+1) ArrayAppend(a, b[i]);
  return a;
}
</cfscript>

<cfset a = ArrayNew(1)>
<cfset ArrayAppend(a, "A")>
<cfset ArrayAppend(a, "B")>
<cfset ArrayAppend(a, "C")>

<cfset b = ArrayNew(1)>
<cfset ArrayAppend(b, "X")>
<cfset ArrayAppend(b, "Y")>
<cfset ArrayAppend(b, "Z")>

<cfset a = ArrayJoin(a, b)>

<cfoutput>
<cfloop index="i" from="1" to="#ArrayLen(a)#">
  #a[i]#<br>
</cfloop>
</cfoutput>

Jim


----- Original Message -----
From: "James Sleeman" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, February 24, 2002 11:48 PM
Subject: joining arrays


> Hi all,
>          anybody know if there is a nicer way of joining arrays in CF than
>
>          i = 1;
>          while (i lte arrayLen(secondArray)) {
>                  arrayAppend(firstArray, secondArray[i]);
>          };
>
>
>
>
> James Sleeman
> Innovative Media Ltd
> Phone: (03) 377 6262
> http://www.websolutions.co.nz/
>
> CAUTION: The information contained in this email message is confidential
> and may be legally privileged. If the reader of this message is not the
> intended recipient you are notified that any use, dissemination,
> distribution or reproduction of this message is prohibited. If you have
> received this message in error please notify the sender immediately and
> destroy the original message and any attachments.
>
> Views expressed in this communication may not be those of Innovative Media
Ltd.
> 
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to