Leaderboard
Popular Content
Showing content with the highest reputation on 02/17/2020 in all areas
-
While @Neutro answer is correct, I don't get your 12 Mb data -> 1 Mb .xls file, but that's unimportant. More worrisome is the issue with Excel (or AutoIt, or C, or Fortran, whatever) handling of numeric data, particularly with evolving algorithms, when you can't easily back them up by a strong uncertainty calculation nor a fixed target precision (that is: I want the result of the following computation to be correct within +/- 1e-9). It's indeed very easy to get completely wrong results using widely used languages/tools, seemingly simple algorithms and inconspicious real-world data, even with well established IEEE floating-point. See for instance https://www.autoitscript.com/forum/topic/197061-floating-point-can-be-toxic/1 point
-
Maybe something like this would work better : Local $hidden = False ;while and switch code goes here Case $Button6 $count -= 1 If $count = 0 Then $count = 2 GUICtrlSetImage($Pic1,$count = 2 ? 'P2.jpg' : 'P1.jpg') if $hidden Then GUICtrlSetState ($Pic1, $GUI_SHOW) $hidden = False endif Case $Button7 GUICtrlSetState ($Pic1, $GUI_HIDE) $hidden = True I made it work with 2 pictures. Do not use == in If comparaison unless you want to compare case sensitive strings.1 point
-
Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Moderation Team1 point
-
Non Std App Usage - 20 year old program
FrancescoDiMuro reacted to TheXman for a topic
If it's the data that you're after, why are you trying to retrieve it from application controls instead of finding where the actual data is stored and trying to extract it directly from the file or source where it resides? It appears that you are intentionally being vague when it comes to the name of the application. Without more information, it would be very hard to give you any other suggestions.1 point -
Excel Object Reliability
Earthshine reacted to jchd for a topic
I'm very happy with the couple {Mathematica, SQLite}. Yes I know: while SQLite is powerful and free, Mathematica is fantastic but not exactly cheap. I particularly appreciate its language and the uncompared possibilities it offers to manipulate and represent data. Yet if you're serious about modelling real-world data and behavior, you should consider investing in a serious tool.1 point -
_GUICtrlEdit_AppendText freezes gui
TheAutomator reacted to Melba23 for a topic
TheAutomator, The Devs have looked into the problem and, as Nine and I reported, it appears that Win 10 edit controls do not like having single @CR characters passed to them - so we can put this problem down to MS and not AutoIt. To enable you to use the _GUICtrlEdit_AppendText function we suggest using something like this: Func ADD($message) For $i = 1 To StringLen($message) Sleep(50) ; Look for @CR and @LF If StringMid($message, $i, 1) = @CR Or StringMid($message, $i, 1) = @LF Then ; If @CR then check it is followed by @LF and send @CRLF in one call and pass over the trailing @LF If StringMid($message, $i, 2) = @CRLF Then $i += 1 _GUICtrlEdit_AppendText($console, @CRLF) Else _GUICtrlEdit_AppendText($console, StringMid($message, $i, 1)) EndIf Next EndFunc ;==>ADD That works for us on all the examples you posted. We will now consider whether we need to adjust the Help file to reflect this new behaviour of the edit control under Win 10. M231 point -
One of the large number of ways to achieve that parsing: Local $opt1 = 'estado = "" , cep = "", idade=32, nome = "Luismar", campo="campo = campo"' Local $opt2 = 'age=12,name=bob,hobbies="games,reading",phrase="I''m cool!"' Local $s $s = StringRegExp($opt1, '(?m)([^=]+?) ?= ?(?|"([^"]*?)"|([^,]*?)) ?(?:,|$)', 3) _ArrayDisplay($s) $s = StringRegExp($opt2, '(?m)([^=]+?) ?= ?(?|"([^"]*?)"|([^,]*?)) ?(?:,|$)', 3) _ArrayDisplay($s) If you actually need a {key, value} scripting dictionary from the result, build one from the output array.1 point
-
rm4453, Found the solution... _GDIPlus_GraphicsClear() Should have known that, but I've never used it before. Thanks for your help.1 point
-
Windows Message Monitor
argumentum reacted to LarsJ for a topic
Updates: Errors under AutoIt 3.3.14.5 because functions have been moved to other UDFs. Corrected. Added a few lines in ViewMessages.au3 to display messages from an OnEvent mode script. Grouping toolbar listview items by checked/unchecked state (August 15, 2018) has caused problems while counting messages. The functionality has been removed again. Updated WM_Messages.txt. If you compare Windows messages in Includes\Messages\ with e.g. all the Wine messages, the latter contains far more messages. However, many of these messages originate from Windows XP and earlier and are apparently no longer used. These old messages have not yet been added. I'm considering a bit whether to add or not. New 7z-file at bottom of first post.1 point -
It seems @Danyfirex is right. After some tests, it seems this one works : Extern "Windows-MS" Type tA f1 As Integer f2 As Integer End Type Public Function addition(no1 As Integer, no2 As Integer, Byref v As tA Ptr) As Integer Export Dim o As tA Dim s As Integer o.f1 = no2 o.f2 = no1 *v = o Return 0 End Function End Extern Local $ptr = DllStructCreate("int f1;int f2") $aRet = DllCall('test.dll', 'int', 'addition', 'int', 10, 'int', 30, 'ptr*', DllStructGetPtr($ptr) ) ConsoleWrite( "F1=" & DllStructGetData($ptr, 'f1') & @LF & _ "F2=" & DllStructGetData($ptr, 'f2') & @LF )1 point
-
Trying to use plink to SSH login and send Linux commands.
edumanilha reacted to Marc for a topic
For sending simple commands (never had the need to let a script run on the remote machines), I use RunWait(@ComSpec & ' /c "c:\Program Files\putty\plink.exe" -ssh root@SERVERNAME -pw PASSWORD halt', @SystemDir) which will send the "halt" command to the server. You'll find much more useful input here:1 point -
DllCall to my dll function returning structure is not working.
IndianSage reacted to Danyfirex for a topic
Hello I'm not a freebasic programmer but I think your structure will be free when the function ends. probably you need to use a global structure. I'm not sure if freebasic provide structure pointer or need to use a function like strptr or varptr like old vb6 or something like @Mystructure. I think is not a good practices to return an structure from a library. the correct way should be that you pass your structure's pointer an be filled/modify inside the library. Saludos1 point -
_GUICtrlEdit_AppendText freezes gui
TheAutomator reacted to Nine for a topic
Seems there is some kind of a bug in Win10. It may be related to the previous one, but I didn't test it. Someone should report it to MicroSoft. Anyway, I think I have found a workaround. You must use the patch that I made and change your function to this : Func ADD($message) Local $char For $i = 1 To StringLen($message) $char = StringMid($message, $i, 1) If Asc ($char) = 13 Then $char &= @LF If Asc ($char) = 10 Then ContinueLoop _GUICtrlEdit_AppendText($console, $char) Sleep(50) Next EndFunc ;==>ADD The message gets stuck from time to time when @CR is sent alone. I will let @Melba23 decide how he would like to manage it.1 point -
DllCall - to my dll function - returns blank or zero only. - (Moved)
IndianSage reacted to jchd for a topic
$aResult is an array. Please read help.1 point -
Thank you Jayme. After a break from programming I went through your book again and can't recommend it enough to anyone wanting to program with Autoit. Frank1 point
-
[Solved] Stop GUI until message box closed
Colduction reacted to Melba23 for a topic
AnonymousX, A better solution is to set the correct style for the MsgBox like this: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example") Local $idOK = GUICtrlCreateButton("OK", 310, 370, 85, 25) local $but = GUICtrlCreateButton("Hello", 150,150,85,25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) MsgBox($MB_TOPMOST + $MB_TASKMODAL,"Message","Try hitting the hello button several times,without closing this window. Now close this window and see how script wasn't restricted it just was waiting and storing the instructions") WinWaitClose("Message") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idOK Exit case $but MsgBox(0,"","Hello") EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc ;==>Example All is explained in the Modal MsgBox Styles tutorial in the Wiki. M231 point -
Array Loop while deleting elements
PoojaKrishna reacted to BrewManNH for a topic
You need to loop through your array in reverse, otherwise you'll end up deleting the wrong elements, or your loop will run past the end of the array. #include <Array.au3> Local $bResult[1], $aResult[6] = ["5", "Item1", "*Item2", "Item3", "Item4", "*Item5"] ;Loop through an array and remove any element starting with "*" For $x = $aResult[0] To 1 Step - 1 ; < << <<< Loop through the array in reverse If StringLeft($aResult[$x], 1) = "*" Then ; This will test if item $x in the array starts with "*" $bResult[0] = _ArrayAdd($bResult, $aResult[$x]) ; if it does, Add it to a second array and store the Array size in $bResult[0] $aResult[0] = _ArrayDelete($aResult, $x); remove the element from the array and store the new array size in $aResult[0] EndIf Next _ArrayDisplay($aResult, "Source") ;Display what was in the source array _ArrayDisplay($bResult, "Destination") ;Display what was moved to the destination array.1 point