The code commented below just won't give me the results I want. I inserted the code commented into my code below and it doesn't work?
My code below is the "original" code.
It should only display one occurence of every directory in \data directory from the below variable.
full_directory_list = "C:\temp,C:\tmp,C:\windows,D:\data,D:\temp,D:\data\dir1,D:\data\dir1,D:\data\dir1,D:\data\dir2,D:\data\dir2,E:\temp"
<!---
<cfloop from=1 to="#listLen(full_directory_list)#" index=i>
<cfif i IS 1 OR (i GT 1 AND listgetat(full_directory_list,i) NEQ listgetat(full_directory_list,i-1))>
<p>#listgetat(full_directory_list,i)#</p>
</cfif>
</cfloop>
--->
<!--- My code --->
<cfloop index=dir_name list="#full_directory_list#">
<cfif findnocase("data",dir_name,1)>
<cfif columnmode EQ 1>
<tr valign="top">
</cfif>
<td class="dirlinks">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td class="dirlinks" valign="top">
<input type="Checkbox" value="#dir_name#" name="Dir_Access" <CFIF LISTCONTAINS
(qGetData.strShowMe,dir_name,",")>Checked</CFIF>></td>
<td class="dirlinks">
<CFIF LISTCONTAINS(qGetData.strShowMe,dir_name,",")>
<font color="red"><b>#listLast(dir_name, "\")#</b></font>
<CFELSE>
#listLast(dir_name, "\")#
</CFIF>
</td>
</tr>
</table>
</td>
<cfif columnmode MOD 5 EQ 0>
<tr>
</cfif>
<cfset columnmode = columnmode + 1>
</cfif>
</cfloop>
On Wed, 05 May 2004 13:47:12 -0400, Nathan R. Jessop wrote:
>
>I substituted the "list" with my variable but I get errors? I get an invalide parser construct found on line 244 which is this line:
>
><cfif i = 1 OR (i GT 1 AND listgetat(full_directory_list,i) NEQ listgetat(full_directory_list,i-1)>
>
>
>
><cfloop from=1 to="#listLen(full_directory_list)#" index=i>
> <cfif i = 1 OR (i GT 1 AND listgetat(full_directory_list,i) NEQ listgetat(full_directory_list,i-1)>
> <p>#listgetat(full_directory_list,i)#</p>
> </cfif>
></cfloop>
>
>
>
>On Wed, 5 May 2004 10:30:37 -0700, Ian Skinner wrote:
>
>>If you just want to not display duplicates
>>
>><cfoutput>
>><cfloop from=1 to="#listLen(list)# index=i>
>> <cfif i = 1 OR (i GT 1 AND listgetat(list,i) NEQ listgetat(list,i-1)>
>> <p>#listgetat(list,i)#</p>
>> </cfif>
>></cfloop>
>></cfoutput>
>>
>>
>>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
