Nested arrays & probability - Coldfusion - Advanced Techniques

Let say I have a 2D array; myarray="A" myarray="B" myarray="C" myarray="D" myarray="E" myarray="F"...

1. Nested arrays & probability

Let say I have a 2D array;
myarray="A"
myarray="B"
myarray="C"
myarray="D"
myarray="E"
myarray="F"
Neotoxin Guest 2. Re: Nested arrays & probability

First of all, you can not use the "+" to concatenate two alphabetic strings. You must use "&":
nextarray=myarray & myarray & myarray &...

jdeline Guest 3. Re: Nested arrays & probability

Ok. I'll take note, but can someone show me how to make those loops...
Neotoxin Guest 4. Re: Nested arrays & probability

Btw, I forgot to mention that the same thing can be done using index looping,
if I'm using 1D array that contain lists, for example:
<cfset myarray=ArrayNew(1)>
<cfset myarray="A,B,C,D">
<cfset myarray="E,F">
<cfset myarray="G,H,I">
<cfloop index="p" list="#myarray#" delimiter=",">
<cfloop index="q" list="#myarray#" delimiter=",">
<cfloop index="r" list="#myarray#" delimiter=",">
<cfoutput>#p##q##r#<br></cfoutput>
</cfloop>
</cfloop>
</cfloop>

The only problem is, by using that method, the number of nested loops depend
on the myarray's length. What if the myarray's length is dynamic (could be
1,2,3,...or 100 maybe)?. Is it possible to use a predefined template and use
<cfinclude> inside the loop? If it is, how would I do it?

Neotoxin Guest  Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•