home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows ArrayNew --->
- <HTML>
- <HEAD>
- <TITLE>ArrayNew Example</TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>ArrayNew Example</H3>
-
- <!--- Make an array --->
- <CFSET MyNewArray = ArrayNew(1)>
- <!--- Note that ArrayToList will not function properly
- if the Array has not been initialized with ArraySet --->
- <CFSET temp = ArraySet(MyNewArray, 1,6, "")>
-
- <!--- set some elements --->
- <CFSET MyNewArray[1] = "Sample Value">
- <CFSET MyNewArray[3] = "43">
- <CFSET MyNewArray[6] = "Another Value">
-
- <!--- is it an array? --->
- <CFOUTPUT>
- <P>Is this an array? #IsArray(MyNewArray)#
- <P>It has #ArrayLen(MyNewArray)# elements.
- <P>Contents: #ArrayToList(MyNewArray)#
- <!--- Note that the array has expanded dynamically
- to six elements with the use of ArraySet, even though
- we only set three values --->
-
- </CFOUTPUT>
- </BODY>
- </HTML>
-