Resets an array to a specified minimum number of elements. Resetting can improve performance, if used to size an array to its expected maximum. For more than 500 elements, use ArrayResize immediately after using the ArrayNew tag.ColdFusion arrays expand dynamically as data is added.
The updated array after resizing.
ArrayResize(array, size) |
Parameter |
Description |
|---|---|
array |
Name of an array |
size |
Minimum array size |
<cfscript>
myArray=ArrayNew(1)
// Resize that array to the number of records
temp = arrayResize(myArray, 8)
writeDump(myArray)
</cfscript>
Output
Sign in to your account