Usually coldfusion gives a reason for the error, instead of just stating the
error.  Now whats the reason??

-----Original Message-----
From: Larry Juncker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 10:29 AM
To: CF-Talk
Subject: Error trying to create an Array


Can anyone tell me why I keep getting the following error:

An error occurred while evaluating the expression:

    temp = ArraySet(LineItemarray,1,6,"")

Error near line 47, column 7

the code that I am trying to run is below:

<!--- Make an array --->
<cfset LineItemArray = ArrayNew(2)>

<cfloop from="1" to="#LineItemCt#" index="itemRow">
 #ListGetAT(Cust_ItmLst,ItemRow,'~')#<BR>

<!--- ArrayToList will not function properly if the Array has not been
  initialized with ArraySet --->
<cfset temp = ArraySet(LineItemArray,1,6,"")>

<!--- set some elements --->
<cfset LineItemArray[itemRow][1] = "#ListGetAt(Cust_ItmLst,1,' ')#">
<cfset LineItemArray[itemRow][2] = "">

<!--- Find out where PackageSize is located in this string --->
<cfset PackageSizePOS = ListFindNoCase(Cust_ItmLst,"PackageSize:"," ")>
<cfloop from="2" to="#Evaluate(PackageSizePOS-1)#" index="ct">
 <cfset LineItemArray[itemRow][2] = #LineItemArray[itemRow][2]# &' ' &
#ListgetAt(Cust_ItmLst,ct,' ')#>
</cfloop>

<cfset LineItemArray[itemRow][3] =
"#ListGetAt(Cust_ItmLst,PackageSizePOS+1,' ')#">
<cfset LineItemArray[itemRow][4] =
"#ListGetAt(Cust_ItmLst,PackageSizePOS+2,' ')#">
<cfset LineItemArray[itemRow][5] =
"#ListGetAt(Cust_ItmLst,PackageSizePOS+3,' ')#">
<cfset LineItemArray[itemRow][6] =
"#ListGetAt(Cust_ItmLst,PackageSizePOS+5,' ')#">

</cfloop>

<!--- is it an array? --->

  <P>Is this an array? #IsArray(LineItemArray)#
  <P>It has #ArrayLen(LineItemArray)# elements.
  <P>Contents: #ArrayToList(LineItemArray)#
<!--- the array has expanded dynamically to six elements
with the use of ArraySet, even though we only set three values --->


Any quick anwsers on this would be GREATLY Appreciated.



______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to