
Heron
Active Members-
Posts
43 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by Heron
-
Hi all, it's long time ago that I posted this tool. Feedback was mainly the lack of a help file. Since I still use the tool for my daily work and decided to distribute it to my department I bastled a helpfile together. So why not post it here? During reviewing I noticed several issues candidate for improvement, but who cares? Also post the source code for whoever can use it. *&^#*@ Cannot upload the file, it is more than my upload quota?! Ok, will see how to post it (but not today). Bye
-
Hi AutoIt nerds, who can help me out with this issue? It is driving me nuts. I found a great activeX control, MSTgrid, that is much easier for me than listview with all the options I need. However there's a strange thing going on. I have bound to the control to receive its events and it does so as expected BUT... the precise moment I enter a key when in the edit mode of a cell all of the events stop firing from then on. And it doesn't start again either when out of the edit mode. The same control bound to VB or to Excel works as expected and gives events like KeyPressEdit and ChangeEdit and so on. I have no clue as why AutoIt behaves different. Below a sample script and the free control to download (which has to be installed of course). #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=D:\nlrgo\My Documents\My AutoIt Scripts\SQList2\datagrid.kxf $Form1 = GUICreate("Form1", 719, 451, 228, 124, BitOR($WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_SYSMENU,$WS_CAPTION,$WS_CLIPCHILDREN,$WS_BORDER,$WS_CLIPSIBLINGS)) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_Close") $Obj1 = ObjCreate("MstGrid.grdView") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 10, 10, 500, 300) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Event = ObjEvent($Obj1, "MSTEvent_") $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MSTEvent_($ev) ConsoleWrite("Event: " & $ev & @CRLF) EndFunc Func Form1_Close() Exit EndFunc Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) EndFunc While True Sleep(100) WEnd It seems that I cannot attache the control but you can download it from everywhere. Thanks!
-
Hi Polps, I see what you mean. You confuse the loop with the breakpoint. The script is in one of two modes: or it is executing normally, or it paused. When it is paused (when you check the variables, etc) then the loop is halted. The events, like closing the window, are not stored for when the loop is executed again and thus not detected. So yes, the only way is to resume (the script is running again) and then close the window. What you can do however is to set a breakpoint in the GUIClose function, resume and close the window. The script is halted in the eventhandler then. Greetz, Heron
-
Hi Polps, your english is perfectly clear for me, no problem. The command pane is not refreshed indeed. This is intended, there can be another or more statements in the command area, and you don't want them to execute each time automatically! But I admit that the array's values cannot be read easily from the variable list (only a few values at a time). I've been thinking about it before, when you click on the variable in the list and then the values are displayed in the result pane? Should that be an option? Your other points: 1. Don't know what script you are testing. I have no problems with the events, can you send your script maybe? 2. The white dots are not removed indeed, this can be fixed with little effort I think. The blue breakpoints however are comfortable to remain between the debug sessions I think. Do you agree? Thanks for your response, highly apprieciated! Gr, Heron
-
Oh, and about your questions: 1) It's possible (in the next release) to delete the DBugScript file on exit? -> yes, *if* there is a new release, this is not a big deal. 2) Wich is the best way to monitoring array value step by step (not using code tooltips)? -> not sure what you're asking for. For one value of the array you could add a variable to the list (ex: v_arr[1][2]). It will be shown every time you break in the same function. And after a restart of the script you can 'restore saved list' (if you saved it first ). 3) Can you shortly explain the meaning of the "Save list", "Restore original list" buttons? -> 'Save list' will store the (modified) variable list (and the command/result pane) for the particular function. 'Restore original list' will restore the list with all the variables of the current function (or global vars when outside a function). Hope this helps.
-
Hi Polps! Thanks for your kind words. Actually I'm not working on it anymore, partly because of the pale reactions on the forum. I just decided this weekend to create a Youtube info video as appetizer. Maybe more people will like it. I use it myself from time to time and it has never crashed (although there are odd issues ). I'll try to post a link to the video now. Bye DBUG video (Sorry for the bad quality, it's my first video ever!)
-
_Service_UDF v4 : Build your own service with autoit code
Heron replied to arcker's topic in AutoIt Example Scripts
In the main loop of the example there is a logprint of an WaitForSingleObject function. This is blocking the main loop. Confusing - Heron - -
Hi there, Update 4 arrived. Buttons, images and variable value under cursor. - Heron -
-
Need help getting two scripts communicating
Heron replied to DrJeseuss's topic in AutoIt General Help and Support
Hi, thanks for your code, it is very clean, should be an example in the help file! However it doesn't fit my needs. First it seems limited to max approx 100 messages per second and secondly, it misses massages when the receiver is not fast enough (try a Sleep(1000) in the GUIGetMsg() loop). But thanks for thinking with me, really appreciated! - Heron - -
Need help getting two scripts communicating
Heron replied to DrJeseuss's topic in AutoIt General Help and Support
Hi there, I stumbled upon this thread by searching for multithreads (no pun intended). The reason is I'm exploring the same area of communicating between scripts, mainly to overcome the limitation of AutoIt being single threaded. I know of several options: pipes, environment variables, memory structures, windows messages and even file transfer, but did not experiment with them yet. But I did manage to communicate interscriptical by using straightforward AutoIt. Why not use _GUICtrlEdit_SetText() to write in the (hidden) edit box of a second script? First get the handle with ControlGetHandle() each time you want to write. It's much faster then I had expected. First I used polling to signal new data but this was to slow and gave complications when more senders were writing to the same script. Therefore I learned working with events, which was easier than I feared, for triggering and synchronizing. This way I could sent up to 2000 lines per second to another script! However I still don't know how to process the messages fast enough. When the receiving script is slow then the sending script is still delayed. I guess I have to use queues to cope with this but that's another story. - Heron - -
M23, it's not nearer, it is exactly what I want! I was already playing with this idea but couldn't get it right. And no thanks for the question, you're welcome Thanks, Heron
-
Thanks for your fast reply! Indeed, I considered the slider already but wanted the standard look&feel. Also the slider has no 'line buttons' or however they are called, I mean the up/down buttons to scroll one line. But maybe I end up with the slider nevertheless - Heron -
-
Hi there, is it possible to create a stand alone ScrollBar control. It will be used for something different then scrolling contents of a edit/listview control or window. It must generate notify messages to handle changes. I guess I'm not the only one with this desire. Anybody advise to get me on the way? Thanks - Heron -
-
multi-dimensional array to merged flat arrays.
Heron replied to MvGulik's topic in AutoIt Example Scripts
Hi, I did something similar for displaying array (n-dimensional) contents in a debugger window. It converts to a string and is very compact, but then there is no error handling in the way you do. Func _DispArr(ByRef $ar, ByRef $out, $d=0, $cnt=0) ;display values of n-dimension array Local $res If $cnt = 0 Then Dim $cnt[UBound($ar, 0)] For $i = 0 to UBound($ar, $d+1) if $i = UBound($ar, $d+1) Then Return $d-1 $cnt[$d] = $i if $d < UBound($ar, 0) - 1 Then $d = _DispArr($ar, $out, $d+1, $cnt) ;recursive call if $d = UBound($ar, 0) - 1 Then $res = Execute("$ar[" & _ArrayToString($cnt,"][") & "]") $out &= @CRLF & StringTrimLeft($DBGident, 4) & "[" & _ArrayToString($cnt,"][") & "] " & _Type($res) & ' = ' & @TAB & _Value($res, true) EndIf Next EndFunc I think you have the same approach but I didn't study it. As usual I get headache wich these recursive things... - Heron - -
Hi there, thanks for all who worked on this script to get it working. I was looking for something like this and could very well use it (be it that I broke it down to handle just one folder). One thing noted: when stopping and resuming the script, often it will crash. I tried to cleanup the event and struct variables but that didn't help. Finally I found that calling WinAPI CloseHandle() for the directory- and eventhandler did the job. Now monitoring can be stopped and resumed as much as you like. Just wanted to share this with you. - Heron -
-
[Solved] StringRegExp() recursion.
Heron replied to MvGulik's topic in AutoIt General Help and Support
I don't think it's possible, at least not with one statement. You'll have to use, a limited count, of submatches. Indeed we don't know what your aim is, if you can change the notation you could do it with StringSplit(). - Heron - -
Hi, I'm looking for a program like this. I tried it with some files and not all are working (.rtf). No idea why, didn't look into the code yet. - Heron -
-
Hi there, again a update to the original post. Now the debugger program allows for debugging the whole script, line by line. Had not much response on the first releases but hey, I had an awful lot of fun writing it. Guess I'm the only one that writes script with bugs in it
-
Original post changed, see update2. Heron
-
Good point! I saw it once in the past but forget it. I will use it in the new version!
-
Hi, thanks for your responses and tips. I like to know how other people have dealt with the issues I face myself. I have reworked the original script of this post and left the idea of passing the function variables by reference. Now I read the variables using a recursive Execute call. Writing variables is done in the same way. Doing so the variables are evaluated in there own scope. Now there is no limitation in the number of variables that can be read and the scope of the variables is determined accurate. Furthermore the script is more robust, it does't fail when variables are not declared or are constants. I will upload it soon. Next problem (there is always a next problem) is interfering of the debug GUI with the application's GUI's. I consider using only Hotkeys to prevent problems. Are there any tips you can give me in this area? For example: 1) the debug script doesn't know the EventMode of the application to debug, 2) the message handler of the application steals the debugger's one, 3) control ID's of the application are shifted because of the debugger's one, etc...
-
@Dolemit50, indeed, varDump looks much like the way I print variables and I can see how it works. I liked the idea of displaying an array within an array. I will use it too, be it not recommended. But the use of Execute is dirty programming anyway. Thanks for your tip!
-
@Martin: I like your debugger project but it's way to complex for me. I can't even get it to work, must be doing something wrong. It says: running script in debugger and I see the debugger GUI but nothing happens when I press Start or step or whatever. Has the testscript to be in the same directory? Can you explain the basic idea of your debugger? How do you get the variable values read? Is the test script first rewritten with debug statements? (I know, a fool can ask more then 100 wise men can answer...)
-
Dolemite50, indeed the script allows for changing on the fly of global variables but also of local variables in the function! The commandline also gives a way to play and test all kind of built-in functions. For example type StringRegExp('abcde', '',2) and inspect the contents of the result array immediatly, it's fun! Also allowed are stupid things as $arr[1] = $obj or Msgbox(0,'',$var). Try it. Don't understand with my broken english, but do I want to know? _dumpVar.au3 I don't know, what is it and where can I find it? Thanks for your reply
-
Hi Martin, I think your debugger is much more advanced, mine is more an advanced msgbox(). The whole idea is passing variables By Reference to the debugger function. In this way it is possible to display, but also assign variables manually which is a big plus. However, you can't pass a constant to a ByRef function parameter as you know, so this is where it fails. Is there a way to check if a variable is a constant, something like IsConst($var) that you know?