Wednesday, July 28, 2010

Coldfusion One Liners


"So a CF programmer walks into a bar...."





















http://www.samfarmer.com/

UNDOCUMENTED: LOOPING OVER FILES:

cfloop file="somefile.txt" index="theline"
cfoutput #theline# /cfoutput
/cfloop



CF9: Cfdocument can convert MS doc <- > PDF

Build Structures in a line:

<cfset variables.mystructure="{AL="Alabama",DC="District of Columbia"}>


QUICK WAY TO DO MODULUS: (this will change alternate lines for example)
<cfif currentrow % 2>class="alt"</cfif>

2 comments:

  1. Loop over a file line by line
    Each line of the file gets assigned to the variable in index. Even better ColdFusion reads the file line by line and does not put the file in memory. CF can now work with huge log files efficiently.

    ReplyDelete
  2. CF9 Caching looks really powerful.

    ReplyDelete

Note: Only a member of this blog may post a comment.