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

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