Thanks for the suggestion, but I sometimes use multi-line TODOs so it wouldn't
be as simple as looping through line by line.
> >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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275893
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4