JuergenF Posted November 29, 2004 Share Posted November 29, 2004 Dear all, I created a kind of debug mode using the TrayTip Function (see below). I would like to display the current line number within the script where the call of the function "Statusmsg" was done. In other words: How can I find out at runtime which line of the script is processed at the moment ? _____________________________________________________ Statusmsg("Wait for xxxx","[ Line 165 ]") . . Statusmsg("Wait for yyyyy","[ Line 170 ]") Statusmsg("Wait for yyyyy","[ Line <Variable for current line number> ]") Func Statusmsg($msg, $Zeile) ;=================STATUS================ TrayTip("Clear old ToolTip","",0) TrayTip("", $msg & @LF & $Zeile, 20) ;======================================= EndFunc Link to comment Share on other sites More sharing options...
MHz Posted November 29, 2004 Share Posted November 29, 2004 Why not use Opt("TrayIconDebug", 1) read line number from your tray icon. Tacomas 1 Link to comment Share on other sites More sharing options...
JuergenF Posted November 29, 2004 Author Share Posted November 29, 2004 Why not use Opt("TrayIconDebug", 1) read line number from your tray icon.<{POST_SNAPBACK}>Great !!That is just I was looking for.Thanks a lot Juergen Link to comment Share on other sites More sharing options...
ezzetabi Posted November 29, 2004 Share Posted November 29, 2004 (edited) Or for debugging purpuses also ToolTip()s are useful since they shows messages without stopping the script as MsgBox()es allowing seeing evolution of values of variant of what ever you need. E.g. Why does this returns 0? msgbox(0,'',_Factor(100)) Func _Factor($iValue) Local $c, $result = 1 $iValue = Abs(Int($iValue)) For $c = 2 to $iValue $result = $result * $c ;###### Debug info ToolTip($result) Sleep(100) ;###### Debug info Next Return $result EndFunc Seeing the tooltips it is easy to understand. There is an overflow!! Edited November 29, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now