A lot of enhancements have been made to the core CFML syntax that will aid in developing ColdFusion-based applications elegantly. One of the primary enhancements is the introduction of member functions for data structure and data objects. You can now start coding in a true object oriented style. 

For instance, consider the following headless function:

ArrayAppend (empArr, emp)

It can now be written as:

empArr.append(emp)

where 'arrayObj' is a reference to the CFArray class.

The following example depicts the new usage of member functions:

//The old way
var myArray = ArrayNew(1);
ArrayAppend(myArray, "objec_new");
ArraySort(myArray, "ASC");

// The new way
myArray.append("objec_new");
myArray.sort("ASC");

// The new way
var myProductObject = createObject("java", "myJavaclass");
myjavaList = myProductObject.getProductList();
myjavaList.add("newProduct"); // Java API

myjavaList.append("newProduct"); // CF API
myjavaList.sort("ASC");
</cfscript>

Member function for the following data types are supported:

  • Array
  • String
  • List
  • Struct
  • Date
  • Spreadsheet
  • XML
  • Query
  • Image                                                             

In the 2016 release of ColdFusion, there is a change in the return type for append member functions. For example,

  • anystruct.append() returns appended structure
  • anyarray.append() returns appended array

Supported Array member functions

The following Array member functions are supported:

ArrayAppend someVar.append()
ArrayAvg someVar.avg()
ArrayClear someVar.clear()
ArrayContains someVar.contains()
ArrayDelete someVar.delete()
ArrayDeleteAt someVar.deleteAt()
* ArrayDeleteNoCase someVar.deleteNoCase()
ArrayEach someVar.each()
ArrayFilter someVar.filter()
ArrayFind someVar.find()
ArrayFindAll someVar.findAll()
ArrayFindAllNoCase someVar.findAllNoCase()
ArrayFindNoCase someVar.findNoCase()
ArrayInsertAt someVar.insertAt()
ArrayIsDefined someVar.isDefined()
ArrayIsEmpty someVar.isEmpty()
ArrayLen someVar.len()
ArrayMap someVar.map()
ArrayMax someVar.max()
ArrayMin someVar.min()
ArrayPrepend someVar.prepend()
ArrayResize someVar.resize()
ArraySet someVar.set()
ArraySlice someVar.slice()
ArraySort someVar.sort()
ArraySum someVar.sum()
ArraySwap someVar.swap()
ArrayToList someVar.toList()
ArrayReduce someVar.reduce()

* New in Adobe ColdFusion (2016 release)

Supported String member functions

The following String member functions are supported:

Function Member function
* decodeForHTML someVar.decodeForHTML()
* decodeFromURL someVar.decodeFromURL()
* EncodeForCSS someVar.encodeforCSS()
* EncodeForHTML someVar.encodeforHTML()
* EncodeForHTMLAttribute someVar.encodeforHTMLAttribute()
* EncodeForJavaScript someVar.encodeforJavaScript()
* EncodeForURL someVar.encodeforURL()
* EncodeForXML someVar.encodeforXML()
* EncodeForXMLAttribute someVar.encodeforXMLAttribute()
* EncodeForXPath someVar.encodeforXPath()
* Encrypt someVar.encrypt()
* getSafeHTML someVar.getSafeHTML()
* isSafeHTML someVar.isSafeHTML()
* paragraphFormat someVar.paragraphFormat()
* ReplaceListNoCase someVar.replaceListNocase()
* urlDecode someVar.urlDecode()
* urlEncodedFormat someVar.urlEncodedFormat()
BinaryDecode someVar.binaryDecode()
BinaryEncode someVar.binaryEnecode()
Canonicalize someVar.canonicalize()
CharsetDecode someVar.charsetDecode()
CharsetEncode someVar.charsetEncode()
CJustify someVar.cJustify()
Compare someVar.compare()
CompareNoCase someVar.compareNocase()
Decrypt someVar.decrypt()
Encrypt someVar.encrypt()
Find someVar.find()
FindNoCase someVar.findNoCase()
FindOneOf someVar.findOneOf()
FormatBaseN someVar.formatBaseN()
GenerateSecretKey someVar.generateSecretKey()
GetToken someVar.getToken()
Hash someVar.hash()
HTMLCodeFormat someVar.htmlCodeFormat()
HTMLEditFormat someVar.htmlEditFormat()
Insert someVar.insert()
JSStringFormat someVar.jssStringFormat()
LCase someVar.lCase()
Left someVar.left()
Len someVar.len()
LJustify someVar.lJustify()
LSIsCurrency someVar.lsIsCurrency()
LSIsDate someVar.lsIsDate()
LSIsNumeric someVar.lsIsNumeric()
LSParseCurrency someVar.lsParseCurrency()
LSParseDateTime someVar.lsParseDateTime()
LSParseEuroCurrency someVar.lsParseEuroCurrency()
LSParseNumber someVar.lsParseNumber()
Mid someVar.mid()
ParagraphFormat someVar.paragraphFormat()
ParseDateTime someVar.parseDateTime()
REFind someVar.reFind()
REFindNoCase someVar.reFindNoCase()
REMatch someVar.reMatch()
REMatchNoCase someVar.reMatchNoCase()
RemoveChars someVar.removeChars()
RepeatString someVar.repeatString()
Replace someVar.replace()
ReplaceList someVar.replaceList()
ReplaceList someVar.replaceList()
ReplaceNoCase someVar.replaceNocase()
REReplace someVar.reReplace()
REReplaceNoCase someVar.reReplaceNoCase()
Reverse someVar.reverse()
Right someVar.right()
RJustify someVar.rJustify()
RTrim someVar.trim()
SpanExcluding someVar.spanExcluding()
SpanIncluding someVar.spanIncluding()
StripCR someVar.stripCR()
ToBase64 someVar.toBase64()
ToBinary someVar.toBinary()
ToString someVar.toString()
Trim someVar.trim()
UCase someVar.uCase()
URLDecode someVar.urlDecode()
URLEncodedFormat someVar.urlEncodedFormat()
Val someVar.val()
Wrap someVar.wrap()
XmlFormat someVar.xmlFormat()

* New in Adobe ColdFusion (2016 release)

Supported List member functions

The following List member functions are supported:

ListAppend someVar.listAppend()
ListChangeDelims someVar.listChangeDelims()
ListContains someVar.listContains()
ListContainsNoCase someVar.listContainsNoCase()
ListDeleteAt someVar.listDeleteAt()
ListEach someVar.listEach()
ListFind someVar.listFind()
ListFindNoCase someVar.listFindNoCase()
ListFirst someVar.listFirst()
ListGetAt someVar.listGetAt()
ListInsertAt someVar.listInsertAt()
ListLast someVar.listLast()
ListLen someVar.listLen()
ListMap someVar.listMap()
ListPrepend someVar.listPrepend()
ListQualify someVar.listQualify()
ListReduce someVar.listReduce()
ListRest someVar.listRest()
ListSetAt someVar.listSetAt()
ListSort someVar.listSort()
ListToArray someVar.listToArray()
ListValueCount someVar.listValueCount()
ListValueCountNoCase someVar.listValueCountNoCase()

Supported Struct member functions

The following Struct member functions are supported:

StructIsEmpty someVar.isEmpty()
StructAppend someVar.append()
StructClear someVar.clear()
StructCopy someVar.copy()
StructCount someVar.count()
StructDelete someVar.delete()
StructFind someVar.find()
StructFindValue someVar.findValue()
StructGetMetadata someVar.getMetadata()
StructUpdate someVar.update()
StructSort someVar.sort()
StructSetMetadata someVar.setMetadata()
StructInsert someVar.insert()
StructEach someVar.each()
StructKeyArray someVar.keyArray()
StructKeyExists someVar.keyExists()
StructKeyList someVar.keyList()
StructMap someVar.map()
StructReduce someVar.reduce()
StructFindKey someVar.findkey()
StructFilter someVar.filter()
StructToSorted someVar.tosorted()

Supported Date member functions

The following Date member functions are supported:

CreateODBCDate someVar.createODBCDate()
CreateODBCDateTime someVar.createODBCDateTime()
DateDiff someVar.diff()
CreateODBCTime someVar.createODBCTime()
* LSDateFormat someVar.lsDateFormat()
DatePart someVar.datepart()
DaysInYear someVar.daysIn
Second someVar.second()
Minute someVar.minute()
Hour someVar.hour()
Day someVar.day()
Week someVar.week()
Month someVar.month()
* setSecond <DateObject>.setSecond(second)
* setMinute <DateObject>.setMinute(minute)
* setHour <DateObject>.setHour(hour)
* setDay <DateObject>.setDay(day)
* setMonth <DateObject>.setMonth(month)
* setYear <DateObject>.setYear(year)
Quarter someVar.quarter()
Year someVar.year()
DaysInMonth someVar.daysInMonth()
DayOfWeek someVar.dayOfweek()
DayOfYear someVar.dayOfYear()
FirstDayOfMonth someVar.firstDayOfMonth()
DateTimeFormat someVar.dateTimeFormat()
TimeFormat someVar.timeFormat()
DateFormat someVar.dateFormat()
DateAdd someVar.add()
DateConvert someVar.convert()
LSTimeFormat someVar.lsTimeFormat()

* New in Adobe ColdFusion (2016 release)

Supported Image member functions

The following Image member functions are supported:

ImageGetWidth someVar.getWidth()
ImageSetDrawingColor someVar.setDrawingColor()
ImageGetBufferedImage someVar.getBufferedImage()
ImageTranslateDrawingAxis someVar.translateDrawingAxis()
ImageSetDrawingStroke someVar.setDrawingStroke()
ImageNegative someVar.negative()
ImageCopy someVar.copy()
ImageDrawRect someVar.drawRect()
ImageCrop someVar.crop()
ImageGetHeight someVar.getHeight()
ImageGetIPTCTag someVar.getIPTCTag()
ImageDrawOval someVar.drawOval()
ImageSharpen someVar.sharpen()
ImageOverlay someVar.overlay()
ImageGetEXIFTag someVar.getEXIFTag()
ImageDrawBeveledRect someVar.drawBeveledRect()
ImageAddBorder someVar.addBorder()
ImageShear someVar.shear()
ImageInfo someVar.info()
ImagePaste someVar.paste()
ImageDrawArc someVar.drawArc()
ImageShearDrawingAxis someVar.shearDrawingAxis()
ImageDrawRoundRect someVar.drawRoundRect()  
ImageGrayscale someVar.grayscale()
ImageSetDrawingTransparency someVar.setDrawingTransparency()
ImageScaleToFit someVar.scaleToFit()
ImageClearRect someVar.clearRect()
ImageTranslate someVar.translate()
ImageFlip someVar.flip()
ImageWriteBase64 someVar.writeBase64()
ImageSetBackgroundColor someVar.setBackgroundColor()
ImageDrawLine someVar.drawLine()
ImageDrawQuadraticCurve someVar.drawQuadraticCurve()
ImageRotate someVar.rotate()
ImageGetBlob someVar.getBlob()
ImageWrite someVar.write()
ImageBlur someVar.blur()
ImageRotateDrawingAxis someVar.rotateDrawingAxis()
ImageSetAntialiasing someVar.setAntialiasing()
ImageDrawPoint someVar.drawPoint()
ImageDrawCubicCurve someVar.drawCubicCurve()
ImageXORDrawingMode someVar.xorDrawingMode()
ImageDrawText someVar.drawText()
ImageDrawLines someVar.drawLines()
ImageResize someVar.resize()
ImageGetExifMetadata someVar.getExifMetadata()
ImageGetIptcMetadata someVar.getIptcMetadata()

Supported Spreadsheet member functions

The following Spreadsheet member functions are supported:

SpreadsheetDeleteRow someVar.deleteRow()
SpreadsheetFormatColumn someVar.formatColumn()
SpreadsheetShiftRows someVar.shiftRows()
SpreadsheetCreateSheet someVar.createSheet()
SpreadsheetReadBinary someVar.readBinary()
SpreadsheetWrite someVar.write()
SpreadsheetAddRow someVar.addRow()
SpreadsheetShiftColumns someVar.shiftColumns()
SpreadsheetGetCellFormula someVar.getCellFormula()
SpreadsheetDeleteColumns someVar.deleteColumns()
SpreadsheetAddFreezePane someVar.addFreezePane()
SpreadsheetDeleteColumn someVar.deleteColumn()
SpreadsheetSetCellComment someVar.setCellComment()
SpreadsheetSetActiveSheetNumber someVar.setActiveSheetNumber()
SpreadsheetSetHeader someVar.setHeader()
SpreadsheetAddSplitPane someVar.addSplitPane()
SpreadsheetMergeCells someVar.mergeCells()
SpreadsheetFormatRows someVar.formatRows()
SpreadsheetGetCellComment someVar.getCellComment()
SpreadsheetGetCellValue someVar.getCellValue()
SpreadsheetGetColumnCount someVar.getColumnCount()
SpreadsheetAddInfo someVar.addInfo()
SpreadsheetSetCellValue someVar.setCellValue()
SpreadsheetSetFooter someVar.setFooter()
SpreadsheetRemoveSheet someVar.removeSheet()
SpreadsheetSetRowHeight someVar.setRowHeight()
SpreadsheetSetActiveSheet someVar.setActiveSheet()
SpreadsheetFormatCellRange someVar.formatCellRange()
SpreadsheetFormatCell someVar.formatCell()
SpreadsheetAddRows someVar.addRows()
SpreadsheetFormatColumns someVar.formatColumns()
SpreadsheetAddImage someVar.addImage()
SpreadsheetSetCellFormula someVar.setCellFormula()
SpreadsheetAddColumn someVar.addColumn()
SpreadsheetDeleteRows someVar.deleteRows()
SpreadsheetSetColumnWidth someVar.setColumnWidth()
SpreadsheetFormatRow someVar.formatRow()
SpreadsheetInfo someVar.info()
SpreadsheetAddAutoFilter someVar.addAutoFilter()
SpreadsheetAddPageBreaks someVar.addPageBreaks()

Supported XML member functions

The following XML member functions are supported:

XmlTransform someVar.transform()
XmlGetNodeType someVar.getNodeType()
XmlChildPos someVar.childPos()
XmlElemNew someVar.elemNew()
XmlSearch someVar.search()

Supported Query member functions

The following Query member functions are supported:

QueryAddColumn someVar.addColumn()
* QueryEach someVar.Each()
QueryGetRow someVar.getRow()
QueryConvertForGrid someVar.convertForGrid()
* QueryKeyExists someVar.keyExists()
* QueryFilter someVar.Filter()
* QueryMap someVar.Map()
* QueryReduce someVar.Reduce()
QuerySetCell someVar.setCell()
* QuerySort someVar.Sort()
QueryAddRow someVar.addRow()
* QueryGetResult someVar.getResult()
* ValueArray someVar.valueArray()

* New in Adobe ColdFusion (2016 release)

Supported Display and formatting member functions

The following Display and formatting member functions are supported:

* BooleanFormat someVal.booleanFormat()
* YesNoFormat someVal.yesNoFormat()

* New in Adobe ColdFusion (2016 release)

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