

|
|
Variables in CFML; Mixing NotationThere are many cases where you must mix notations in the same reference to retrieve the value that you need. The most common of which is accessing query values using Dot notation to specify the column and Indexed notation to specify the row in the form queryName.ColumnName[RowNumber]. This also will occur when you scope references to arrays as in Request.myArray[1].
Careful planning should be made to properly consider how you will construct these complex nests of data and special thought should be given to how you will access the data within them. Consider the following complex data set: <cfset MainStruct = StructNew()> Assuming that the above were fully populated with data all of the following (and many others) would be legal references to values within the structure and its children:
Although such complex creations can be incredibly useful organizers of data it should be clear that they can quickly grow out of control. Creating, and maintaining, standards for both the creation and referencing of such objects is highly recommended. |