Important alert: (current site time 7/16/2013 6:27:13 AM EDT)
 

article

New ColdFusion 5.0 Feature Highlights

Email
Submitted on: 5/1/2001 1:20:31 AM
By: Rabid Nerd Productions  
Level: Beginner
User Rating: By 1 Users
Compatibility: Cold Fusion 4.5, Pre Cold Fusion 4.5
Views: 23721
author picture
(About the author)
 
     This article helps to explain the usefulness of the new ColdFusion 5 CFML Language features, including CFFLUSH, Query of Queries, User Defined Functions (UDFs), CFSAVECONTENT, and CFGRAPH. A sample UDF is included! (Hint: it is a function that outputs RollOver Image Code!)


 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				

New ColdFusion 5.0 Feature Highlights

by Herbert L. Riede
Programmer, WinDough.com, Inc.

This article was updated May 6th with an updated UDF demo for cross-browser compatibility

CFFLUSH

This new tag enables you to "Flush" what a ColdFusion page has generated so far to the browser. Currently, HTML Output is not sent to the visitor's browser until the entire page has been processed. This tag enables you to output the top of the page or a small "Page Loading" message while the rest is processed. You _cannot_ use any tags that alter the HTTP header once you Flush.. It will throw a CFError. No CFLocation's after a Flush!!
Link to Allaire's (-ahem- Macromedia's) Description


Query of Queries

This new feature enables you to run a query on a recordset already returned from a query, without hitting the database again. It can also be used to perform SQL queries against <CFDIRECTORY> listings, as well as on information returned by other tags as a recordset.
Link to Allaire's (-ahem- Macromedia's) Description


User Defined Functions (UDFs)

This is a new CFScript feature (but you can use the functions you write in cftags or #function(var)# formats)

A simple demonstration would be a function that creates roll-over code for you:
<cfoutput>
#RollOver("MyImg", "myimg.gif", "myrollover.gif",
"http://mysite.com")#
</cfoutput>
<cfscript>
function RollOver( name, img, imgover) {
HTMLOut = "<a href='";
if (ArrayLen(Arguments) eq 4) {
 HTMLOut = "#HTMLOut##Arguments[4]#'";
} else {
 HTMLOut = "#HTMLOut####name#' name='#name#'";
}
HTMLOut = "#HTMLOut# onmouseover='#name#.src = ""#imgover#"";' onmouseout='#name#.src = ""#img#"";'><img src='#img#' name='#name#' border=0></a>";
 return HTMLOut;
}
</cfscript>

This works in CF5 and outputs:

<a href='http://mysite.com' onmouseover='MyImg.src = "myrollover.gif";' onmouseout='MyImg.src = "myimg.gif";'><img src='myimg.gif'
name='MyImg' border=0></a>

Note I only declared 3 arguments in RollOver. This enables you to call it with only 3 arguments for No-Link Rollovers. The fourth argument, if it exists, is the URL to link to. IF I HAD DECLARED ALL FOUR, ALL FOUR WOULD HAVE BEEN REQUIRED.. So this is an example of optional arguments as well..

Also note that I COULD do this with a custom tag, but a collection of these short functions all in one file could be a POWERFUL include file.. Include a function library in your application.cfm and you will have built your own language extensions!
Link to Allaire's (-ahem- Macromedia's) Description


CFSAVECONTENT

This new tag takes ColdFusion to a whole new level. Just wrap CFSaveContent around, well, anything and do anything with it. Similar to having a custom tag process "ThisTag.GeneratedContent" (If you don't know what I'm talking about, don't worry), but this "offers significant performance improvements over custom tag solutions." (MacroMedia ColdFusion 5 Beta Site)
Link to Allaire's (-ahem- Macromedia's) Description


CFGRAPH

A new Multimedia tag, CFGRAPH outputs GIF, JPG, and FLASH graphs and charts - in Pie, Line, and Bar format. There is SO MUCH ABOUT THIS TAG, You need to visit their site to learn all about it!
Link to Allaire's (-ahem- Macromedia's) Description


I plan on writing CF5 Function Libraries, Graph examples and more in the near future. I think these New Features will have me working late to take advantadge of all the new possibilities.

I invite your comments, and any questions you may have. If this tutorial was valuable to you, please vote!


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/1/2001 2:43:17 AM[C][F][5][0]

Hi, I never worked with this product.
I worked with and know how to use html/cgi/asp/sql/html/dhtml/javascript/flash but never did anything with ColdFusion. Can you please tell me what is does? Any Help At All will be Very Helpfull.

I know it has to do something about websites for webmasters! :-)

Do you have any information for newbies like my-self that can help me learn this Lang. ? Again, Thanks For Any Help.

(Note: Please, Email me with any info. if possible. I don't come here often. So, I don't come back to the pages I visited. [Thx.])

----------
Thanks For Supporting Open Source.
----------

(If this comment was disrespectful, please report it.)

 
8/16/2004 10:01:40 AM

I am receiving error 'Windows NT error number 1450 occurred' while loading large excel files. Will this version get rid of this problem?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.