>I need to get a list of all the TODOs in a list of (primarily .cfm) files.
>
>In the unlikely event of people not being familiar with TODOs, they're just
>CFML comments like this:
><!--- TODO: Thing I have to do --->

You could loop over the file contents line-by-line using the end-of-line 
characters as the delimiter and extract the TODO text using a regular 
expression.  Then either output the text or store it in an array/struct for use 
later on.

  <cfset eol = Chr(13) & Chr(10)>
  <cfloop list="#contents#" delimiters="#eol#" index="line">
  
    <cfif FindNoCase("TODO:",line)>
      <cfset stLenPos = REFindNoCase("<!--- TODO: (.*?) --->", line, 1, TRUE)>
      <cfoutput>#Mid(line, stLenPos.pos[2], stLenPos.len[2])#<br></cfoutput>
    </cfif>
   
  </cfloop>

Argument 4 of REFindNoCase, if set to TRUE, causes CF to return a structure 
containing two arrays that show the Position and Length of each matching 
subexpression.  The first array element is the match on the entire regex.  The 
second array element is the subexpression in parentheses.

 Michael Mongeau

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274674
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to