home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Documentation / snippets / listlen.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  796 b   |  31 lines

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