B and E Blog

Just a couple of opinionated nerds talking about ColdFusion, PHP, and technology in general.

B and E Blog header image 2

ColdFusion 8.0.1 - Nested Array/Struct Shorthand

April 10th, 2008 · No Comments · ColdFusion, Programming

As you probably know, ColdFusion 8 gave us a long-needed shorthand for creating arrays and structures:

  1. a = "1",
  2. b = "2",
  3. c = "3"
  4. }>
  5. "a",
  6. "b",
  7. "c"
  8. ]>

Unfortunately you couldn’t nest those constructs. With the 8.0.1 updater though, you now can:
  1. a = ["x", "y", "z"],
  2. b = ["s", "t", "u"],
  3. c = ["m", "n", "o"]
  4. }>

This is fantastic when you’re trying to make configurable code - a chunk of code whose basic function is tweakable by updating a few settings variables at the top instead of hard-coding them in throughout the code (for example - URLs, filesystem paths, data sources, etc).

Tags:

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment