Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AutoHotkey_L v1.1.05.05


  • Please log in to reply
30 replies to this topic
MilesAhead
  • Members
  • 578 posts
  • Last active: Feb 29 2016 05:15 PM
  • Joined: 21 Jan 2009
I've just started playing around with try catch Exception() and I noticed with the example if I run it out of SciTE then e.Line shows the correct line. But when compiled I can't seem to guess how to adjust e.Line to account form some difference introduced by the compilation. If I account for commented and blank lines I can get A_LineNumber to correlate, but e.Line doesn't seem to play by the same rules.

try
    BadlyCodedFunc()
catch e
    MsgBox % "Error in " e.What ", which was called at line " e.Line 

BadlyCodedFunc() {
    throw Exception("Fail", -1)
}


"Some people, when confronted with a problem, think I know, I'll use regular expressions.  Now they have two problems."

- Jamie Zawinski