I need to create a shopping cart there are many variables like Shirts,CompanyText,Desiner_Names,Company,Cons_Name,DSNR_Cert_Number,DSNR_Cert_Issued_Date etc. Here "Shirts,CompanyText,Desiner_Names" are all Array type variables where "Shirts" is the main Array.
So i need to basically work on Array that has inside it 2 different Arrays along with other variables two Arrays inside an Array. The code is
<!--- create a MAIN array --->
<cfset Shirts= ArrayNew(1) />
<!--- "Cons_Code" is the key value taken from "Cons_name" and "Company_Text_Code"
Also every time a user selects a new "Shirt", a new key "Cons_Code" is created --->
<cfset Cons_Code = 2 >
<!--- create a structure --->
<cfset stShirts[Cons_Code] = StructNew() />
<!--- assign values to our structure --->
<cfset stShirts[Cons_Code].Company_Text_Code = "" /><!---
<cfset stShirts[Cons_Code].CompanyText = "333" />--->
<cfset stShirts[Cons_Code].Desiner_Names = ArrayNew(1) />
<cfset stShirts[Cons_Code].Desiner_Names[1] = "PARIS" />
<cfset stShirts[Cons_Code].Desiner_Names[2] = "LONDON" />
<cfset stShirts[Cons_Code].Desiner_Names[3] = "MILAN" />
<cfset stShirts[Cons_Code].CompanyText = ArrayNew(1) />
<cfset stShirts[Cons_Code].CompanyText[1] = "perryellis" />
<cfset stShirts[Cons_Code].CompanyText[2] = "arrow" />
<cfset stShirts[Cons_Code].CompanyText[3] = "polo" />
<cfset stShirts[Cons_Code].Cons_Name = "" />
<cfset stShirts[Cons_Code].DSNR_Cert_Number = "" />
<cfset stShirts[Cons_Code].DSNR_Cert_Issued_Date = "" />
<cfset ArrayAppend( Shirts, StructCopy( stShirts[Cons_Code] ) ) />
<!--- store structure in our array --->
<cfoutput>
<cfloop from="1" to="#ArrayLen(Shirts)#" index="row">
Row #row#:
#Shirts[row].CompanyText[1]#,
#Shirts[row].Desiner_Names[2]#,
#Shirts[row].Cons_Name#<br />
#Shirts[row].DSNR_Cert_Issued_Date#<br />
</cfloop>
</cfoutput>
Sometimes I am getting the error
"You have attempted to dereference a scalar variable "
Also am i doing the right thing by having 2 arrays inside an one by one Aray/Shirts? This "Shirts" contains at least 150 other different vairables, that go into session. Help pleez. xain hu