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

  1. <!--- This example shows ListInsertAt --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ListInsertAt Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9. <H3>ListInsertAt Example</H3>
  10.  
  11. <!--- First, query to get some values for our list. --->
  12. <CFQUERY NAME="GetParkInfo" DATASOURCE="cfsnippets">
  13. SELECT     PARKNAME,CITY,STATE
  14. FROM    Parks
  15. WHERE    PARKNAME LIKE 'CH%'
  16. </CFQUERY>
  17. <CFSET temp = ValueList(GetParkInfo.ParkName)>
  18. <CFSET insert_at_this_item = ListGetAt(temp, "3", ",")>
  19.  
  20. <CFOUTPUT>
  21. <P>The original list: #temp#
  22. </CFOUTPUT>
  23. <!--- Now, insert an item at position three. --->
  24. <CFSET temp2 = ListInsertAt(Temp, "3", "my Inserted Value", ",")>
  25.  
  26. <CFOUTPUT>
  27. <P>The changed list: #temp2#
  28. <BR><I>Note that <B>#insert_at_this_item#</B> has moved from 
  29. position three of the list to position four.</I>
  30. </CFOUTPUT>
  31.  
  32. </BODY>
  33. </HTML>       
  34.   
  35.