Hello All,
The code below works fine for a 1 dimensional array. When convert it to
2/3 dimensional I get an error.
<CFSet FileArray = ArrayNew(1)>
<CFOutPut Query="DirList">
<CFSET StopHere=#RecordCount#>
</CFOutPut>
<CFLoop Query="DirList" StartRow=1 EndRow=#StopHere#>
<CFSet Underscore1 = Find("_", #NAME#, 1)>
<CFSet Underscore2 = Find("_", #NAME#, #UnderScore1#+1)>
<CFIF #Underscore2# >0
<CFSet FileArray[ArrayLen(FileArray)+1]=#Left(Name,UnderScore1)#>
</CFIF>
</CFLoop>
<CFOutPut>
#ARRAYLen(FileArray)#
<CFSet FileList = ArrayToList(FileArray)>
#FileList#
</CFOutPut>
*********************************************
<CFSet FileArray = ArrayNew(2)>
<CFOutPut Query="DirList">
<CFSET StopHere=#RecordCount#>
</CFOutPut>
<CFLoop Query="DirList" StartRow=1 EndRow=#StopHere#>
<CFSet Underscore1 = Find("_", #NAME#, 1)>
<CFSet Underscore2 = Find("_", #NAME#, #UnderScore1#+1)>
<CFIF #Underscore2# >0
<CFSet FileArray[ArrayLen(FileArray)+1][1]=#Left(Name,UnderScore1)#>
</CFIF>
</CFLoop>
<CFOutPut>
#ARRAYLen(FileArray)#
<CFSet FileList = ArrayToList(FileArray)>
#FileList#
</CFOutPut>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
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