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

  1. <!--- This example shows ListGetAt and ListLen --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ListGetAt Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>ListGetAt 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 list of usernames who have posted messages numbers
  20. <CFOUTPUT>#ListLen(temp)#</CFOUTPUT> users.</H3>
  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.