Nested delimiters (#)

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Nested delimiters (#)

    I created a bunch of vars using a loop and named them: X#LoopCount# so you
    end up with X1, X2, X3... all as variables. Now I want to use a loop to go back
    through and access each value:

    <cfloop index="LoopCount" from="1" to="#max#">
    <cfoutput>#X#LoopCount##</cfoutput>
    </cfloop>

    This obviously does not work. Does anyone know of a work around? Thank you for
    your time.
    Jake

    JakeFlynn Guest

  2. Similar Questions and Discussions

    1. Using PDPageStmGetToken - is it possible toget \r and space delimiters?
      Hi, I was able to correctly read my stream tokens via PDPageStmGetToken, but I could see that I could get only tokens themself and not space or...
    2. Nested controls
      "Dan Caron" <spam1@caronit.com> wrote in message news:01b101c369ac$ee21a6a0$a101280a@phx.gbl... In which event do you check on Page.IsPostBack?...
    3. Single versus Double quote marks as string delimiters
      Hi All, I have heard other people say that PHP can parse double quoted strings (e.g., "Hello, World") faster than it can parse single quoted...
    4. Parsing a PHP String without Delimiters
      I'm trying to figure out how to parse the MySQL Date/Time group '20031001155704' into meaningful data (i.e. - year, month, day, hour, minute, and...
    5. extended ascii delimiters when when writing to outputstream
      Whenever I write to Response.Outputstream after doing a plain response.write, I get a delimiter between the two writes that is made up of three...
  3. #2

    Default Re: Nested delimiters (#)

    You can either:

    Evaluate the item e.g. #evaluate('X' & LoopCount)# which isn't really
    recommended, as it has performance issues.

    or

    Scope the variable #variables['X' & LoopCount]# (this works for all most if
    not all CF structures)


    e.g
    <cfset X23 = "hello">
    <cfset LoopCount = 23>

    <cfoutput>#variables['X' & LoopCount]#</cfoutput>

    stpaz Guest

  4. #3

    Default Re: Nested delimiters (#)

    stpaz,
    I had to use your first (evaluate) option because I was working with cookie vars. That did the trick, thanks!
    JakeFlynn Guest

  5. #4

    Default Re: Nested delimiters (#)

    One last question how would you check if it is defined incrementally?

    isdefined does not work with #evaluate('X' & LoopCount)#...
    JakeFlynn Guest

  6. #5

    Default Re: Nested delimiters (#)

    Don't use evaluate, just reaplace variables for cookie eg #cookie['X' & LoopCount]#
    Stressed_Simon Guest

  7. #6

    Default Re: Nested delimiters (#)


    One last question how would you check if it is defined incrementally?

    isdefined does not work with #evaluate('X' & LoopCount)#...


    try this:
    isdefined("X#loopcount#")
    stpaz Guest

  8. #7

    Default Re: Nested delimiters (#)

    try this:
    isdefined("X#loopcount#")

    That did the trick thanks again stpaz
    JakeFlynn 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