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

  1. <!--- This example shows ListFirst, ListLast, and ListRest --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ListFirst Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>ListFirst 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. <!--- Show the first user in the list --->
  19. <P>The first user in the list is <CFOUTPUT>#ListFirst(temp)#</CFOUTPUT>.
  20. <P>The rest of the users in the list is as follows:
  21. <CFOUTPUT>#ListRest(temp)#</CFOUTPUT>.
  22. <P>The last user in the list is <CFOUTPUT>#ListLast(temp)#</CFOUTPUT>
  23.  
  24. </BODY>
  25. </HTML>       
  26.