Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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?
    3. 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.
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139