ColdFusion 9.0 Resources |
Populating an array with the ArraySet functionYou can use the ArraySet function to populate a 1D array, or one dimension of a multidimensional array, with some initial value, such as an empty string or zero. This can be useful to create an array of a certain size, without adding data to it right away. One reason to do this is so that you can reference all the array indexes. If you reference an array index that does not contain some value, such as an empty string, you get an error. The ArraySet function has the following form: ArraySet (arrayname, startrow, endrow, value) The following example initializes the array myarray, indexes 1 - 100, with an empty string: ArraySet (myarray, 1, 100, "") |