Arrayswap - MACROMEDIA COLDFUSION MX 61-CFML Reference

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

ArraySwap

Description
Swaps array values of an array at specified positions. This function is more efficient than multiple
tags.
cfset
Returns
True, on successful completion.
Category
Array functions
Function syntax
ArraySwap(array, position1, position2)
Parameters
Parameter
array
position1
position2
Example
<h3>ArraySwap Example</h3>
<cfset month = ArrayNew(1)>
<cfset month[1] = "February">
<cfset month[2] = "January">
<cfset temp = ArraySwap(month, 1, 2)>
<cfset temp = ArrayToList(month)>
<p>Show the results: <cfoutput>#temp#</cfoutput>
Description
Name of an array
Position of first element to swap
Position of second element to swap
ArraySwap
393

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents