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

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