User Guide

Tag and function examples 21
Tag and function examples
This section provides remedies for some of the compatibility issues listed in Chapter 3, “Tag and
Function Changes.
Using cfregistry in ColdFusion MX
The
cfregistry tag is deprecated for UNIX and Linux platforms. Therefore, you must remove it
on UNIX to avoid compatibility problems when migrating to a later version of ColdFusion MX.
As an alternative, you can store variables in the following scopes:
Client
Text file
Encoded text file
Database
LDAP server
In Windows, you can continue to store client variables in the registry as in ColdFusion 5.
However, you should not use
cfregistry to read ColdFusion settings from the registry, such as
the mail root and information about Verity collections and scheduled tasks, because much of this
information is no longer stored in the registry, or it is in a different location in the registry. The
ColdFusion settings that are stored in the registry are subject to change. Therefore, you should
not rely on registry keys that ColdFusion creates to store its system settings.
Using ListSort in ColdFusion MX
When sorting with
textnocase in a descending order, ColdFusion 5 and ColdFusion MX
return the results in a different order. However, both are correct because in a
textnocase sort,
apple” is equal to “APPLE”.
In ColdFusion MX, a descending
textnocase sort returns the elements in the exact reverse order
as in an ascending
textnocase sort. This is different than in ColdFusion 5.
The following code produces different results in ColdFusion MX than in ColdFusion 5:
<cfset list = "orange,Orange,apple">
<cfset listAsc = ListSort(#list#, "textnocase", "asc")>
<cfset listDesc = ListSort(l#list#, "textnocase", "desc")>
<cfdump var = #listAsc#>
<cfdump var = #listDesc#>
This code produces the following results for ascending and descending sort operations in
ColdFusion 5 and ColdFusion MX:
For more information, see the
ListSort function in CFML Reference.
Sort order ColdFusion 5 results ColdFusion MX results
Ascending (
listAsc) apple, orange,Orange apple,orange,Orange
Descending (
listDesc) orange, Orange, apple Orange,orange,apple