-1


i need to create a array of line items "arrayOfQuoteLineItem". in place of position value i have to associate name for position,how to do it in coldfusion8? i have seen some code on the "http://www.bennadel.com/blog/1676-Learning-ColdFusion-9-Delete-Array-Elements-With-ArrayDelete-.htm" for coldfusion9 but not for coldfusio8?


QuoteLineItem
   nmfcClass = "100"
   weight = "300"

1 Answers1

1

Associative arrays are called "structures" or "structs" in CF. You can nest structs in arrays, or structs in structs, or whatever you need.

<cfset quoteLineItems = arrayNew(1) /> <!--- or <cfset quoteLineItems = [] /> --->
<!--- probably some looping code here --->
<cfset st = structNew() /> <!--- or <cfset st = {} /> --->
<cfset st.nmfcClass = 100 />
<cfset st.weight = 300 />
<cfset arrayAppend(quoteLineItems, st) />
<!--- end loop --->
Sharondio
  • 2,605
  • 13
  • 16