Nested arrays & probability

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Nested arrays & probability

    Let say I have a 2D array;
    myarray[1][1]="A"
    myarray[1][2]="B"
    myarray[1][3]="C"
    myarray[2][1]="D"
    myarray[3][1]="E"
    myarray[3][2]="F"
    Neotoxin Guest

  2. Similar Questions and Discussions

    1. Nesting Arrays within arrays.
      How do i nest an array inside another array? something like array(i).aray2(j); Can I do that?
    2. XMLConnector complex example with nested arrays
      I'd like to use an XMLConnector and a dataset to consume the following XML structure: <dataset timestamp="2005-12-16T15:23:15.00"> --<region...
    3. simple probability problem using PERL
      Hi If I want to randomly generate a dice (4 side) roll, I can use the following expression: $roll = 1 + int( rand(4)); This assumes that...
    4. #25262 [Bgs]: Nested arrays in POST not processed correctly
      ID: 25262 User updated by: jal at ambitonline dot com Reported By: jal at ambitonline dot com Status: Bogus Bug...
    5. Make Huge $$$$'s through Statistics & Probability
      First off, I don't need your money, What I need is for you to PAY ATTENTION. THAT IS ALL. I will show you how I make a 100% profit on 75% of my...
  3. #2

    Default Re: Nested arrays & probability

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


    jdeline Guest

  4. #3

    Default Re: Nested arrays & probability

    Ok. I'll take note, but can someone show me how to make those loops...
    Neotoxin Guest

  5. #4

    Default 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[1]="A,B,C,D">
    <cfset myarray[2]="E,F">
    <cfset myarray[3]="G,H,I">
    <cfloop index="p" list="#myarray[1]#" delimiter=",">
    <cfloop index="q" list="#myarray[2]#" delimiter=",">
    <cfloop index="r" list="#myarray[3]#" 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 post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139