How to add an element at the end of a List in ColdFusion

ListAppend() - add an element at the end of a List

ListAppend.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ListAppend function example: how to add element at the end of a List</title>
</head>

<body>
<h2 style="color:hotpink">ListAppend Function Example</h2>

<cfset ColorList="DarkMagenta,DarkOliveGreen,Darkorange">
<cfoutput><b>ColorList: #ColorList#</b></cfoutput>

<br />
<cfset Temp = ListAppend(ColorList,"DarkOrchid")>
<cfoutput><b>Temp[After append DarkOrchid]: #Temp#</b></cfoutput>
</body>
</html>






More ColdFusion examples