ColdFusion Tips and Tutorials

ColdFusion Tips and Tutorials. Tips on ColdFusion, AJAX, CSS, JavaScript, HTML, Design, and more.

CFUnited Developer Conference 2010
Use this code TIPSCUST to get $100 off your registration @ CFUnited! We'll see you There!


ColdFusion Tips
Page 1 2 3
148 ColdFusion, Ajax, FuseBox, Tips, and Tut
147 Included Point of View
146 Javascript - OnFocus
145 Nathan's Rules of Professional Web Desig
144 Universal Server-Side Check | Bandwidth
143 Meeting Schedule | Identification Sessio
142 Breaking Frames Without Javascript
141 Unreal Forms
140 Screen Resolution
139 Human Help
138 Better Server-Side Validation
137 Automatic Server-Side Validation
136 Regular Expression Laboratory,ColdFusion
135 Rank-Ordered Site Search
134 Building Cryptograms
133 Well-Formed Includes
132 Grouping Families for Visits
131 Display Families on a Map Grid
130 Slide Shows
129 Determine Your Database Engine
128 ColdFusion in Context: Maxlength Lies
127 Something Extra
126 Parsing Database Structure from Data Def
125 Valid Values Maintenance
124 Print 1
123 Hide Session Id
122 Downsizing Data to Access
121 Time to Load a Page, FuseBox 4
120 Order and Rank by Subset
119 Warn through E-mail & Update on Paste Sp
118 Paste Spreadsheets, ColdFusion Component
117 Review Files Having Fixed-Length Fields
116 Organized Help
115 Sequence Slider
114 Bad Bits
113 Logical Deduction
112 Whiteout
111 Forced Navigation
110 Managing Permissions
109 Time Travel
108 Test First
107 Get Distance Between Map Coordinates
106 Validating Checkboxes
105 Matrix Manipulation
104 Field Help
103 Fake Object Not Found
102 Rank Order Correlation Coefficient
101 From Calling Pairs to Calling Tree
100 Posting Notice
99 Logout Persuasion
98 Release Session Memory
97 Use Identically Named Fields
96 Web Bug
95 Password Generation
94 Core Queries
93 Use CFFTP
92 Insert, Update, and Delete
91 Stack
90 T-Value
89 Bulk Data Entry and E-mail Validation
88 Quick Reset
87 Design 1
86 Use CFFTP
85 Support Login with AutoPost
84 Login and Site Protection
83 XY Graphs in a Graphing Calculator
82 Read Encrypted Files
81 Showing Progress
80 Frugal Cross-Browser Javascript
79 Tabbed Folders
Page 1 2 3



Custom Search
=============================================================
COLDFUSION TIPS PLUS Volume 00 Issue 16
=============================================================

I. My Comments:

II. ColdFusion Tip: 2D Array Sorting

III. Website: webos.org CF Site

IV. Quick Tip: Cntrl - N and cntrl - Tab


=============================================================
I. My Comments:

All Future e-ZINES will be saved in the member area
of my website. I am creating a cf portal for
all of us.

If you have suggestions please email me at cftips @nsnd.com.
Remove the Space to make it work correctly


=============================================================
II. ColdFusion Tip: 2D Array Sorting
=============================================================

<cfapplication sessionmanagement="Yes" name="Test">

<cfset x1="3, 4, 22, 2">
<cfset x2="16, 3, 35, 67">
<cfset x3="43, 45, 68, 62">
<cfset x4="78, 63, 30, 23">
<cfset x5="26, 23, 27, 6">
<cfset x6="11, 84, 74, 43">

<CFSET myArray = ArrayNew(2)>

<cfoutput>

<cfloop from="1" to="4" index="z">

<cfset myArray[1][z]= #ListGetAt(x1,z)#>
<cfset myArray[2][z]= #ListGetAt(x2,z)#>
<cfset myArray[3][z]= #ListGetAt(x3,z)#>
<cfset myArray[4][z]= #ListGetAt(x4,z)#>
<cfset myArray[5][z]= #ListGetAt(x5,z)#>
<cfset myArray[6][z]= #ListGetAt(x6,z)#>

</cfloop>

</cfoutput>


<html>
<head>
<title>Sorting A 2D Array</title>
</head>

<body bgcolor="ffffff">
<center>
<font face="Arial,Helvetica,sans-serif" size="-1" color="000000">
Pick Which Row to Sort
</font>
</center>
<cfparam name="url.row" default="2">
<cfif #url.row# gt 4>
<cfset row=3>
<cfelse>
<cfset row=#url.row#>
</cfif>

<cfoutput>
<table align="center" border="1" bordercolor="006699"
cellpadding="0" cellspacing="0" width="500">

<tr bgcolor="006699">

<td>
<font face="Arial,Helvetica,sans-serif" size="-1" color="FFFFFF">
<b>Before</b></
font>
</td>
</tr>
<tr bgcolor="dddddd">

<td>
<font face="Arial,Helvetica,sans-serif" size="-1" color="000000">
Sort Row
<a href="sorting_a_3d_array.cfm?row=1">1</a> |
<a href="sorting_a_3d_array.cfm?row=2">2</a> |
<a href="sorting_a_3d_array.cfm?row=3">3</a> |
<a href="sorting_a_3d_array.cfm?row=4">4</a>
</font>
</td>
</tr>
<tr>

<td>

<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="dddddd">

<td>#MyArray[1][1]#</td>
<td>#MyArray[1][2]# </td>
<td>#MyArray[1][3]#</td>
<td>#MyArray[1][4]# </td>
</tr>
<tr>

<td>#MyArray[2][1]#</td>
<td> #MyArray[2][2]#</td>
<td>#MyArray[2][3]#</td>
<td>#MyArray[2][4]#</td>
</tr>
<tr bgcolor="dddddd">

<td>#MyArray[3][1]#</td>
<td>#MyArray[3][2]#</td>
<td>#MyArray[3][3]#</td>
<td>#MyArray[3][4]# </td>
</tr>
<tr>

<td>#MyArray[4][1]#</td>
<td> #MyArray[4][2]#</td>
<td>#MyArray[4][3]#</td>
<td>#MyArray[4][4]# </td>
</tr>
<tr bgcolor="dddddd">

<td>#MyArray[5][1]# </td>
<td>#MyArray[5][2]#</td>
<td> #MyArray[5][3]# </td>
<td>#MyArray[5][4]# </td>
</tr>
<tr>

<td>#MyArray[6][1]#</td>
<td>#MyArray[6][2]#</td>
<td> #MyArray[6][3]#</td>
<td>#MyArray[6][4]# </td>
</tr>
</table>


</td>
</tr>
</table>
</cfoutput>
<!--- Now Do the Sorting. --->

<cfset session.TotalRecords = 6>
<cfset session.array_name ="myArray">
<!-- BEGIN BUBBLE SORT -->
<cfset outerloopend = session.TotalRecords>
<cfset innerloopend = session.TotalRecords-1>
<cfset innerloopstart = 1>
<cfset temp = 1>

<CFLOOP INDEX="outerloop" FROM="1" TO="#outerloopend#">
<CFLOOP INDEX= "innerloop" FROM="#innerloopstart#" TO="#innerloopend#">
<cfif #myArray[innerloop][row]# gt #myArray[outerloop][row]#>
<CFSET temp = ArraySwap(myArray,outerloop,innerloop)>
</cfif>
</CFLOOP>
</CFLOOP>
<cfoutput>
<table align="center" border="1" bordercolor="006699"
cellpadding="0" cellspacing="0" width="500">

<tr bgcolor="006699">

<td>
<font face="Arial,Helvetica,sans-serif" size="-1" color="FFFFFF"><b>After</b></font>
</td>
</tr>
<tr>

<td>

<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tr bgcolor="dddddd">

<td>#MyArray[1][1]#</td>
<td>#MyArray[1][2]# </td>
<td>#MyArray[1][3]#</td>
<td>#MyArray[1][4]# </td>
</tr>
<tr>

<td>#MyArray[2][1]#</td>
<td> #MyArray[2][2]#</td>
<td>#MyArray[2][3]#</td>
<td>#MyArray[2][4]#</td>
</tr>
<tr bgcolor="dddddd">

<td>#MyArray[3][1]#</td>
<td>#MyArray[3][2]#</td>
<td>#MyArray[3][3]#</td>
<td>#MyArray[3][4]# </td>
</tr>
<tr>

<td>#MyArray[4][1]#</td>
<td> #MyArray[4][2]#</td>
<td>#MyArray[4][3]#</td>
<td>#MyArray[4][4]# </td>
</tr>
<tr bgcolor="dddddd">

<td>#MyArray[5][1]# </td>
<td>#MyArray[5][2]#</td>
<td> #MyArray[5][3]# </td>
<td>#MyArray[5][4]# </td>
</tr>
<tr>

<td>#MyArray[6][1]#</td>

<td>#MyArray[6][2]#</td>

<td> #MyArray[6][3]#</td>

<td>#MyArray[6][4]# </td>
</tr>
</table>


</td>
</tr>
</table>
</cfoutput>

<center><a href="../index.cfm">Index</a>
<br>
<hr width="400">
<cfinclude template="../footer.cfm">

</body>
</html>


=============================================================

=============================================================
III. Website: webos.org CF Site
=============================================================

webos.org, webos.com, and Hyperoffice.com

This is what the future will look like Check it out a OS
that runs thru the web. Well at least a simulated OS.

But this one is AWESOME!!!

ps. by the way it was made with ColdFusion!!!

=============================================================
IV. Quick Tip: Cntrl - N and cntrl - Tab
=============================================================

Cntrl-N
Gives you a new document

Cntrl Tab Switches from one document to another open
document.

=============================================================
These Quick Tip are things that the average programmer will
know or I think they will know. Just in case you don't
this is a great place to learn about something that make
your life better.
=============================================================


=============================================================
Copyright (c) 2000 NSND.COM
Permission is granted to circulate this publication via
MANUAL forwarding by email to friends provided that the
text is forwarded in its entirety and no fee is charged.
=============================================================
To unsubscribe:
unsubscribe-cftips @nsnd.com
Remove the Space to make it work correctly
=============================================================
To subscribe:
subscribe-cftips @nsnd.com
Remove the Space to make it work correctly
=============================================================

Photo of Nathan Stanford
Nathan Stanford
LinkedIn

R. Marty Ladner's
Site