CFML,UDF,article,helps,explain,usefulness,Col
Quick Search for:  in language:    
CFML,UDF,article,helps,explain,usefulness,Col
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ColdFusion Stats

 Code: 3,680 lines
 Jobs: 17 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for ColdFusion
There is currently no new code. Please check back soon.
Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

New ColdFusion 5.0 Feature Highlights

Print
Email
 

Submitted on: 5/1/2001 1:20:31 AM
By: Herb Riede  
Level: Beginner
User Rating: By 1 Users
Compatibility:Cold Fusion 4.5, Pre Cold Fusion 4.5

Users have accessed this article 7399 times.
 

(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 langauges 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 3 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
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/f lash 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. ----------
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ColdFusion Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.