View comments | RSS feed

CFML functions and variables

The following table describes other CFML functions and variables in ColdFusion MX that differ from ColdFusion Server5:
Function
Status
Issue
For more information
ArrayAvg(), ArrayMin(),
ArrayMax(), ArraySum()
Changed
Returns "0" when used with an empty array. ColdFusion5 returns infinity (1.#INF).
See ArrayAvg(), ArrayMin(), ArrayMax(), and ArraySum() in CFML Reference.
AuthenticatedContext(),
AuthenticatedUser(),
IsAuthenticated(), 
IsAuthorized(), 
IsProtected()
Obsolete
ColdFusion MX is based on a completely different security model than ColdFusion5.
See the "Application Security" chapter in Developing ColdFusion MX Applications with CFML.
DateDiff()
Changed
In ColdFusion5, there is one less second in a minute when calculating a negative difference. For example, it returns 60 seconds between 03:44:23 and 03:45:23, but -59 seconds between 03:45:23 and 03:44:23.
ColdFusion MX calculates negative differences correctly, so if your application contains code that adjusts the ColdFusion5 results, you might have to change it.
See DateDiff() in CFML Reference.
DeleteClientVariable() 
Changed
Returns False when the variable does not exist. ColdFusion5 ignores the function call.
See DeleteClientVariable() in CFML Reference.
GetBaseTagList() 
Changed
Returns prefixed custom tags found in the tag stack in the format x:tag, where x is the prefix that you specified.
See GetBaseTagList() in CFML Reference.
GetLocale()
Changed
When the locale has not been explicitly set using SetLocale(), GetLocale() returns the default locale of the client computer's operating system. In ColdFusion5, GetLocale() returns English(US) when the locale has not been explicitly set.
See GetLocale() and SetLocale() in CFML Reference.
GetTempDirectory()
Changed
(Windows) Returns the temporary directory for the embedded Java application server, instead of the temporary directory for the Windows operating system, as in ColdFusion5.
See GetTempDirectory() in CFML Reference.
IsArray() 
Changed
Returns True with a QueryColumn argument. You can change the value of an array element, but you cannot add or remove an element.
See "QueryColumn object", and IsArray() in CFML Reference.
IsWDDX()
Changed
Returns No for arrays and other complex values. ColdFusion5 returns an error. (Both versions accept a basic value, such as a string, number, logical value, or date and time value. )
See IsWDDX() in CFML Reference.
Len()
Changed
When calculating a length, a string-processing function processes an ASCII 0 (NUL) character and continues to process subsequent characters of the string, if any. In ColdFusion5, these functions did not process any subsequent characters of the string after processing the ASCII 0 (NUL) character.
See Len() in CFML Reference.
ListSetAt()
Changed
No longer changes the first delimiter in the list to the first delimiter specified in the function.
See ListSetAt() in CFML Reference.
ListSort()
Changed
In a descending sort with textnocase, ListSort() returns elements in a different order than in ColdFusion5.
LSCurrencyFormat()
Changed
Returns a negative number when passed a negative number.
With the local argument, returns the currency in the locale's standard format, such as for pounds in the English(UK) locale.
With the international argument, returns the currency with its international currency code, such as AUD for the Australian dollar.
LSIsDate()
Changed
Supports full date and full datetime as parameters, which include the name of the day.
LSParseDateTime()
Changed
For English (US) locales, the following date mask format is obsolete in ColdFusion MX: 23:15:16 4 Sept. 1998. Use a Java standard date format instead.
REFind
REReplace()
REFindNoCase()
REReplaceNoCase()
Changed
Excludes questionable punctuation, such as +, $, and =, in the [[:punct:]] class of regular expression functions.
See REFind(), REReplace(), REFindNoCase(), and REReplaceNoCase() in CFML Reference.
Recognizes accented letters in the appropriate character classes, such as :upper:, :lower:, :alpha:, and so on.
Does not allow the backslash character (\) in a regular expression, even if it is inside a character class []. You must escape it by prefixing an additional backslash (\\). (ColdFusion5 does not require you to escape a backslash in this case.)
REReplace(), 
REReplaceNoCase()
Changed
In replacement strings, the following character pairs now represent case conversion codes: \E, \l, \L, \u, and \U.
If your ColdFusion5 application has a replacement string with one of these character pairs, escape it by prefixing it with a backslash (for example, \\u).
To include special characters for backrefs (\1), prefix them with an additional blackslash (for example, \\1). To include a real backref, prefix an additional backslash (for example, \\\1).
For case conversion codes, additional blackslash prefixes alternate between escaping the code and not. For backrefs, they always escape.
See REReplace() and REReplaceNoCase() in CFML Reference.
StructKeyList
Changed
Returns struct keys in the order they are created, not in alphabetical order like in ColdFusion5.
If you need sorted struct values or keys, you can use the StructSort and StructKeySort functions.
See StructKeyList() in CFML Reference.

Note:   The date pivot point for calculating the century in a two-digit year has changed from ColdFusion5, affecting the results from date functions. For more information, see "Date pivot point for two-digit years".

The ColdFusion section of the Macromedia website contains the most current compatibility information. For more information, go to http://www.macromedia.com/coldfusion.

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


mboles said on Jun 10, 2002 at 3:42 PM :
There is not StrucKeySort function, and StructKeyList does not return the keys in the order they are created.
tomo said on Nov 21, 2002 at 2:59 PM :
that function may not exist, but using structKeyList() with listSort() should help you out a little...

for example:
<cfloop collection="#struct#" item="ii">

would become
<cfloop list="#listSort(structKeyList(struct), "sortorder")#" index="ii">

and you should get the same results. This works in cf4.5 and above, not tested it in anything below cf4.5
darkabyss12345 said on Feb 20, 2003 at 7:50 PM :
I don't think the description about DeleteClientVariable() is
correct.
I have this code
DeleteClientVariable("client.somevar_not_exist")
returns Yes, or True all the time, not False as mentioned in this doc.

Please clarify, Macomedia
darkabyss12345 said on Feb 20, 2003 at 7:54 PM :
Wow!!!!
Something 110% wrong here, I got JSP error message after I
submitted my comments, so I resubmit again, and same error,
now I have 6 comments on this page!
What's wrong Macromedia???!!!
darkabyss12345 said on Feb 20, 2003 at 7:55 PM :
Here is the JSP error I got:
500 Internal Server Error

/cfmxdocs/jtladdcommentaction.jsp:

javax.servlet.ServletException: Exception thrown processing JSP page.
javax.servlet.jsp.JspTagException: Sending failed;
nested exception is:
javax.mail.MessagingException: Unknown SMTP host: smtp.macromedia.com;
nested exception is:
java.net.UnknownHostException: smtp.macromedia.com
at allaire.taglib.SendMailTag.doEndTag(SendMailTag.java:427)
at jrun__jtladdcommentaction2ejsp18._jspService(jrun__jtladdcommentaction2ejsp18.java:271)
at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:175)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:367)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
ppr said on Apr 24, 2003 at 2:49 PM :
IsAuthenticated() is obselete, then why can I not have my own IsAuthenticated function? The code below errors out.

<cffunction name="isAuthenticated" output="false">
<cfset var ret = 1>
<cfreturn ret>
</cffunction>
<cfdump var="#isAuthenticated#">
<cfoutput>#isAuthenticated()#</cfoutput>




robbart said on Jan 8, 2004 at 6:51 AM :
Re: StructKeyList

They say:
Returns struct keys in the order they are created, not in alphabetical order like in ColdFusion 5.
If you need sorted struct values or keys, you can use the StructSort and StructKeySort functions.

However, there is no StructKeySort function in CFMX.

Verify it yourself:

<cfdump var="#getFunctionList()#">

In CF5, Structures were alphabeticly sorted. Now, if I take a struct, and sort it using StructSort, and do a dump of the structure, ala:

<cfdump var="#somestructure#">

Its in alphabetic order.

However, a structkeylist dumps it in REVERSE ALPHABETIC ORDER:

#structKeyList(somestructure)#

which gives:

Modify,Edit,Delete,test,Add

Thats not in the order I put them in the structure, nor in alphabetic order... What gives?
El Smurfa Diablo said on Jan 27, 2004 at 12:57 PM :
in the last stages of migrating to mx.

our menus are done with structs and now I am having a devil of a time getting them to sort as they did on 5.0.

it seems that there should be a StructKeySort of some type.

I haven't been able to figure out how the new struct is ordered....

any clues?
El Smurfa Diablo said on Jan 27, 2004 at 1:20 PM :
TOMO - thanks for the tip it worked fine!
junglefish said on Apr 27, 2004 at 8:08 AM :
I have a similar issue but with an unusual twist. Here's my structure:

<cfset request.bsearchcols = structNew()>
<cfset temp = structInsert(request.bsearchcols, "zeta", "Zeta")>
<cfset temp = structInsert(request.bsearchcols, "alpha", "Alpha")>
<cfset temp = structInsert(request.bsearchcols, "beta", "Beta")>

When I loop over the collection I want them output in the order they were created, ie unsorted (z, then a, then b). However, they always come out alphabetically in key order.

How can I get around this?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/Migrating_ColdFusion_5_Applications/cf_migration_guide7.htm