| View previous topic :: View next topic |
| Author |
Message |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Thu Mar 17, 2005 11:42 am Post subject: A_ScriptLineNumber |
|
|
I usually try to catch all errors before they cause trouble. Normally the script posts an error message about the problem and exits. When I want to debug or change the script I have to look for that message text. A nice improvement would be if the message text would contain the line number of the script.
Is it possible add a variable "A_ScriptLineNumber"?
Then it could look like this: | Code: | | MsgBox, Error in %A_ScriptName% on line %A_ScriptLineNumber%, the variable "toralf" is empty. |
This way I could add code everywhere the MsgBox would always be correct about the line number.
However, I do not know how this could be applied when included code is used (#Include). I use a FEM program that posts errors in these cases as: "Error in line 2343455 of yyy.k which is line 234 in included file xxx.k" _________________ Ciao
toralf  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Thu Mar 17, 2005 8:23 pm Post subject: |
|
|
| This would definitely improve debugging. ListLines shows the line numbers, so there has to be a method already in use of getting the currently running line. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Fri Mar 18, 2005 1:39 am Post subject: |
|
|
| This sounds like a great idea. Since it should be easy to add, I'll try to get it into the next version. v1.0.31 should also have function calling in it, but it might be a week or so before it gets released. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Fri Mar 18, 2005 2:06 am Post subject: |
|
|
Only a week till function calling??!!?!? @_@
::passes out:: |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sat Mar 19, 2005 5:06 pm Post subject: |
|
|
function calling...  |
|
| Back to top |
|
 |
|