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

  1. <!--- This example shows the use of ArrayResize --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayResize Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>ArrayResize Example</H3>
  11.  
  12. <!--- perform a query to get the list of course --->
  13. <CFQUERY name="GetCourses" DATASOURCE="cfsnippets">
  14. SELECT * FROM Courses
  15. </CFQUERY>
  16. <!--- make a new array --->
  17. <CFSET MyArray = ArrayNew(1)>
  18. <!--- resize that array to the number of records
  19. in the query --->
  20. <CFSET temp = ArrayResize(MyArray, GetCourses.RecordCount)>
  21. <CFOUTPUT>
  22. The array is now #ArrayLen(MyArray)# elements, to match
  23. the query of #GetCourses.RecordCount# records.
  24. </CFOUTPUT>
  25.  
  26. </BODY>
  27. </HTML>       
  28.