Sandra, Dave, Sir Isaac,

Thanks for throwing out some ideas.

Not an urgent question - just poking around.

Thanks - J


-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 04, 2006 6:18 PM
To: CF-Talk
Subject: RE: getLineNumber()?

>> I notice the line number is given in the error scope.
>>
>> Does anyone happen to know whether its possible to grab
>> the
>> line number without throwing (and recovering from) an
>> error?
>>
>> I.E.  Something like this
>>
>> 7.
>> 8.
>> 9.   <CFOUTPUT>
>> 10.  #getCurrentLineNumber()#
>> 11.  </CFOUTPUT>
>> 12.
>> 13.
>>
>> ....outputs:
>>
>> 10

> I don't think there's anything built-in to do this - it's
> figured out by the
> compiler, I think.

> However, you could probably write a function or custom tag
> that (very
> inefficiently) uses CFFILE to read the file in question,
> find the number of
> lines in the file up to the point of that tag, and
> displays that number.

The problem you'd have with this is that there probably wouldn't be
any way to reliably output that value more than once without feeding
in the instance of the function in each call to it. I.e.
#getLineNumber(1)# -- #getLineNumber(2)#, etc... I assume you wouldn't
ever use this within a CFC.


s. isaac dealey     434.293.6201
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236992
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to