Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
jdyerjdyer #1
Converting From PHP
I'm converting a site from PHP to ColdFusion and need to find a compatible feature as __LINE__ magic variable in php to report the line number currently executing for logging purposes.
jdyerjdyer Guest
-
Converting into PDF bug...
I am trying to convert a file into PDF (a 20 page one) and I keep getting an error message: "unable to convert file" at the end. It seems to be... -
converting PHP to jsp
does anyone know if a website that has been programmed using PHP can be converted to a site that uses jsp? -
Converting .PDF into CF
Is there a way using Coldfusion MX to convert a .PDF into a web page? I know with the new CF7, there is a cfdocument tag, but I only have CF6. -
Converting wav to wma
Hello List, I googled and found on the list a conversation regarding converting realaudio into mp3s, but what I'm looking to do is convert wav... -
Converting to PDF
How do you install Acrobat distiller printer? It does not appear in my printers in XP. Can you give me the EASIEST steps to set up my computer to... -
jdyerjdyer #2
Re: Converting From PHP
Here is a solution I finally found after searching for three days.
It's hidden on the
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/errors31.htm#wp1131396[/url]
Exception information in catch blocks. I'm not sure if I have the right
number index, but it shouldn't be off by more than one or two. Haven't had a
chance to test yet, but pretty sure this works.
<!--- Get line number of error. --->
<cftry>
<cfthrow type = "get_line_number">
<cfcatch type = "get_line_number">
<cfset err_tag = #CFCATCH.TAGCONTEXT[3]#>
<cfset err_line = #err_tag["LINE"]#>
<cfset err_page = #err_tag["TEMPLATE"]#>
</cfcatch>
</cftry>
<!--- End Get line number of error. --->
jdyerjdyer Guest
-
jdyerjdyer #3
Re: Converting From PHP
The example works except for one thing. The number must be 1 for some reason,
and this always returns the line containing the throw tag. The documentation
says the structure should contain information on all open tags, but in all my
tests, it only allows for the number 1. At least this works good enough for my
problem, if not a little lengthy, but at least it works. If anyone knows how
to get the information from the other opened tags, (i.e. the cfif tag
immediately containing this code, please enlighten me.
jdyerjdyer Guest
-
superbullet #4
Re: Converting From PHP
I am happy you found an answer. You will find some things to me lengthier than
in php, but many things to be alot simpler than in php. The key is to get the
job done.
Goodluck with whatever you're doing.
superbullet Guest
-
PaulH #5
Re: Converting From PHP
the line number is where you told cf there was that specific type of error
w/cfthrow. you could use "Any" to trap all errors or specific cfcatch blocks
w/their own logic if you wanted more granular control. and this info is not
what i would call "hidden".
PaulH Guest



Reply With Quote

