Description

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.

Returns

The updated array after resizing.

Category

Array functions

Function syntax

ArrayResize(array, size)

Parameters

Parameter

Description

array

Name of an array

size

Minimum array size

Example

<cfscript>
    myArray=ArrayNew(1)
    // Resize that array to the number of records
    temp = arrayResize(myArray, 8)
    writeDump(myArray)
</cfscript>

Output

ArrayResize

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy