I am trying to sor this array, but when I change the array type to
"numeric", I get an error that the item in that position is not a number.
Any thoughts.
 
Here's the array code.
 
<!--- get the item the user clicked on --->
<cfquery name="GetID" datasource="#request.site.mainDSN#">
 select *
 from MKT_Page_Links
 where WebSiteIDNO = #Application.websiteidno#
 and MenuIDNO = #val(URL.ID)#
</cfquery>
 
<!--- this is the IDNO of the one the user clicked on --->
<cfset sel = GetID.MenuIDNO>
 
<!--- loop through and get all history for item selected 
   and append to the array --->
<cfset lev = 1>
<cfset MyArr = ArrayNew(1)>
<cfloop condition="GetID.MenuIDNO GT 0">
 <cfquery name="GetID" datasource="#request.site.mainDSN#">
  SELECT *
  FROM MKT_Page_Links
  WHERE WebSiteIDNO = #Application.websiteidno#
  and MenuIDNO = #GetID.MenuLink#
 </cfquery>
 <cfset MyArr[lev] = GetID.MenuIDNO>
 <cfset lev = lev + 1>
</cfloop>
 
<!--- now add the ID the user clicked on to the end of the array --->
<cfset temp = ArrayAppend(MyArr, Sel)>
 
<!--- reverse sort the array in numeric ascending order --->
<cfset temp = ArraySort(MyArr, "text", "asc")>
 
<!--- delete the 0 at the start (main menu) --->
<cfset temp = ArrayDeleteAt(MyArr, 1)>
 
<cfset Lev = ArrayLen(MyArr) + 1>

<!--- blank the rest of the array --->
<cfset temp = ArraySet(MyArr, Lev, 9, 0)>
 
<cfset lev = lev -2>

 

Thank you, 

Issac Rosa 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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