jrottman
Programmer
- Jun 17, 2005
- 47
I have a field in my db that is a list, the list contains all the information of spcecfied directories on my server. I store this list in my db under the field fld_docDisplay.
In each of my test folders I have sub-directories that I am using to organize the files I received by my paperless fax system.
So it looks something like this.
S060099 (file number)
AD (sub directory)
200050501.tif (file I have received and processed)
PC (sub direcetory)
300060604.tif (file I have received and processed)
What I am trying to do is from the list I store in my db, return the list as an array.
Here is the code I am trying to use. Would it be better to store the directories as one list, then store the files as another list.
<cfquery name="test" datasource="#application.dsn#">
select fld_docDisplay from tbl_smartPanel_propInfo_Sale
where fld_fileNum = 'S060099'
</cfquery>
<cfset directoryArray = arrayNew(1)>
<cfloop from="1" to="#ListLen(test.fld_docDisplay)#" index="NDX">
<cfset directoryArray[ndx] = structNew()>
<cfset directoryArray[ndx].DirName = ListGetAt(test.fld_docDisplay,NDX)>\
<cfset directoryArray[ndx].FileName = ListGetAt(test.fld_docDisplay,NDX)>
</cfloop>
<cfdump var="#directoryArray#">
In each of my test folders I have sub-directories that I am using to organize the files I received by my paperless fax system.
So it looks something like this.
S060099 (file number)
AD (sub directory)
200050501.tif (file I have received and processed)
PC (sub direcetory)
300060604.tif (file I have received and processed)
What I am trying to do is from the list I store in my db, return the list as an array.
Here is the code I am trying to use. Would it be better to store the directories as one list, then store the files as another list.
<cfquery name="test" datasource="#application.dsn#">
select fld_docDisplay from tbl_smartPanel_propInfo_Sale
where fld_fileNum = 'S060099'
</cfquery>
<cfset directoryArray = arrayNew(1)>
<cfloop from="1" to="#ListLen(test.fld_docDisplay)#" index="NDX">
<cfset directoryArray[ndx] = structNew()>
<cfset directoryArray[ndx].DirName = ListGetAt(test.fld_docDisplay,NDX)>\
<cfset directoryArray[ndx].FileName = ListGetAt(test.fld_docDisplay,NDX)>
</cfloop>
<cfdump var="#directoryArray#">