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

  1. <!--- This example shows ListGetAt and ListLen --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ListGetAt Example</TITLE>
  5. </HEAD>
  6.  
  7. <BODY>
  8. <H3>ListGetAt 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 list of usernames who have posted messages numbers
  19. <CFOUTPUT>#ListLen(temp)#</CFOUTPUT> users.</H3>
  20. <UL>
  21. <CFLOOP FROM="1" TO="#ListLen(temp)#" INDEX="Counter">
  22.     <CFOUTPUT><LI>Username #Counter#: #ListGetAt("#temp#", "#Counter#")#</CFOUTPUT>
  23. </CFLOOP>
  24. </UL>
  25.  
  26. </BODY>
  27. </HTML>       
  28.       
  29.