home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / arrayclear.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  835 b   |  32 lines

  1. <!--- This example shows ArrayClear --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayClear Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.     
  10. <H3>ArrayClear Example</H3>
  11.  
  12. <!--- create a new array --->
  13. <CFSET MyArray = ArrayNew(1)>
  14. <!--- populate an element or two --->
  15. <CFSET MyArray[1] = "Test">
  16. <CFSET MyArray[2] = "Other Test">
  17. <!--- output the contents of the array --->
  18. <P>Your array contents are:
  19. <CFOUTPUT>#ArrayToList(MyArray)#</CFOUTPUT>
  20. <!--- check if the array is empty --->
  21. <P>Is the array empty?:
  22. <CFOUTPUT>#ArrayIsEmpty(MyArray)#</CFOUTPUT>
  23. <P>Now, clear the array:
  24. <!--- now clear the array --->
  25. <CFSET Temp = ArrayClear(MyArray)>
  26. <!--- check if the array is empty --->
  27. <P>Is the array empty?:
  28. <CFOUTPUT>#ArrayIsEmpty(MyArray)#</CFOUTPUT>
  29.  
  30. </BODY>
  31. </HTML>       
  32.