home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / listlen.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  742 b   |  30 lines

  1. <!--- This example shows ListGetAt and ListLen --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ListLen Example</TITLE>
  5. </HEAD>
  6.  
  7. <BODY>
  8. <H3>ListLen Example</H3>
  9.  
  10. <!--- Find a list of users who wrote messages --->
  11. <CFQUERY NAME="GetMessageUser" DATASOURCE="cfsnippets">
  12. SELECT    Username, Subject, Posted
  13. FROM    Messages
  14. </CFQUERY>
  15.  
  16. <CFSET temp = ValueList(GetMessageUser.Username)>
  17. <!--- loop through the list and show it with ListGetAt --->
  18. <H3>This is a list of usernames who have posted messages
  19. <CFOUTPUT>#ListLen(temp)#</CFOUTPUT> users.</H3>
  20.  
  21. <UL>
  22. <CFLOOP FROM="1" TO="#ListLen(temp)#" INDEX="Counter">
  23.     <CFOUTPUT><LI>Username #Counter#: #ListGetAt("#temp#", "#Counter#")#</CFOUTPUT>
  24. </CFLOOP>
  25. </UL>
  26.  
  27. </BODY>
  28. </HTML>       
  29.       
  30.