AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A_ScriptLineNumber

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Thu Mar 17, 2005 11:42 am    Post subject: A_ScriptLineNumber Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Thu Mar 17, 2005 8:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Fri Mar 18, 2005 1:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Fri Mar 18, 2005 2:06 am    Post subject: Reply with quote

Only a week till function calling??!!?!? @_@

::passes out::
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sat Mar 19, 2005 5:06 pm    Post subject: Reply with quote

function calling... Exclamation Exclamation Exclamation Exclamation Very Happy Very Happy Very Happy Very Happy Wink
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group