Leaderboard
Popular Content
Showing content with the highest reputation on 03/28/2019 in all areas
-
This is the exact opposite of modular programming.2 points
-
Usually a single instance of Excel is enough. But if a user and your script manipulate workbooks at the same time then it might be sensible to separate them by starting a new Excel instance for your script. So you can make sure they do not interfere.2 points
-
You're using "magic" numbers, burn at the stake.1 point
-
Skysnake, The border comes from the default extended style $WS_EX_CLIENTEDGE. So just use 0 in the extended style parameter when you create the edit control to remove it. M231 point
-
My script wont quit at end
Earthshine reacted to Nine for a topic
And spreading your main code between your functions is not helping either. I suggest you create a Func _Main () and regroup all your code into it.1 point -
[Solved]How convert a timestamp to a common time format?
FrancescoDiMuro reacted to Jos for a topic
Sure thing .... Just post the tried code that isn't working when there are issues. Jos1 point -
Finally after a long hiatus, I resumed work on CalibBrowser today, spending several hours on it. See first post for latest upload. When I first started CalibBrowser, there was an enthusiasm not matched by the time available to me. I did try though, and Life just caught up and I ended up juggling too much and in the end, burnt out. Of course, the amount of work involved was not fully apparent when I first started ... but hey, what's new. Seeing as I was still pretty new to SQL though, it was rather a jump in the deep end. Knowing what I was likely in for, I did keep putting it off until I felt rested and free enough. PLEASE NOTE, as I am sure I have mentioned before, that not everything works and not everything that works, works fully or properly. I was motivated today after having a play with the program, but anyone's guess when I will be motivated again .... but it could happen ... tomorrow even. Enjoy!1 point
-
Do excel workbooks require dedicated excel instances?
Rhidlor reacted to FrancescoDiMuro for a topic
@Rhidlor You can use just an instance, since the object you are using is the Application object of Excel, quite the opposite for the Workbook object, which you can have separated files, so in that case they need to be threated in separate variables (as you're already doing)1 point -
@compacting pattern Expr
Deye reacted to FrancescoDiMuro for a topic
@Deye Do you want to replace all lines with GUICtrl* with something or just get the lines with some declarations (Global/Local)?1 point -
Thanks for the information everyone. I got it working now. 1) Needed EOF detection. The StringRegExp for Elasped Time served this purpose. 2) Needed a proper loop. AdLibRegister caused undesirable nesting. While 1 solves this. 3) A few reg expression were invalid. Had to removing ^ and $ at the start and end. 4) Cleaned up the script. Still a WIP tho. #include <Array.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> ;Run RClone Cache Mount on I: Global $iPID_RClone = Run(@ComSpec & " /k rclone.exe mount --vfs-cache-mode full --vfs-cache-max-age 0h1m0s --vfs-cache-poll-interval 1m0s --cache-db-purge --cache-writes --cache-workers 16 --allow-other --acd-templink-threshold 0 --stats 1s --buffer-size 1G --low-level-retries 3600000 --retries 3600000 --retries-sleep 1ms --timeout 5s --contimeout 5s --drive-acknowledge-abuse --drive-skip-gdocs -v gcache:/ I:", "", @SW_SHOW, $STDERR_MERGED) OnAutoItExitRegister("_OnExit") ;Main Idle loop While 1 Sleep(100) _Rclone_Read() WEnd ;This function gets ran when the script is exiting. Func _OnExit() ;Unmount RClone from System before exiting. WinClose("[CLASS:ConsoleWindowClass]") EndFunc ;==>_OnExit ;Read the Rclone stream. Func _Rclone_Read() Local $sOutput, $iCountLoop While 1 ; Read current stream. $sOutput &= StdoutRead($iPID_RClone) ;Elapsed Time Local $aTime = StringRegExp($sOutput, "(Elapsed time:)[\s]*([\w\d\.]+)", $STR_REGEXPARRAYMATCH) If Not @error Then ExitLoop EndIf ;Sleep so we don't overwork the cpu Sleep(10) ;debug $iCountLoop += 1 WEnd ;Transferred Local $aTransferred1 = StringRegExp($sOutput, "Transferred:[\s]*([\w\d\.]+[\s]*\/[\s]*[\d\.]+[\s]*[\w\/]+),[\s]*([\d\.\%\-]+),[\s]*([\d\.]+[\s]*[\w\/]+),[\s]*[\w]+[\s]*[\w\d\-]+", $STR_REGEXPARRAYMATCH) _Rclone_Read_Debug_Check("Transferred 1", $aTransferred1) ;Errors Local $aErrors = StringRegExp($sOutput, "(Errors:)[\s]*([\d\.]+)", $STR_REGEXPARRAYMATCH) _Rclone_Read_Debug_Check("Errors", $aErrors) ;Checks Local $aChecks = StringRegExp($sOutput, "(Checks:)[\s]*([\d\.]+)[\s]*\/[\s]*([\d\.]+),[\s]*([\w\d\-]+)", $STR_REGEXPARRAYMATCH) _Rclone_Read_Debug_Check("Checks", $aChecks) ;Transferred Local $aTransferred2 = StringRegExp($sOutput, "(Transferred:)[\s]*([\d.]+)[\s]*\/[\s]*([\d.]+),[\s]*([\d\%\-]+)", $STR_REGEXPARRAYMATCH) _Rclone_Read_Debug_Check("Transferred 2", $aTransferred2) ;Elapsed Time Local $aTime = StringRegExp($sOutput, "(Elapsed time:)[\s]*([\w\d\.]+)", $STR_REGEXPARRAYMATCH) _Rclone_Read_Debug_Check("Elasped Time", $aTime) ;Files in Transfer Local $aFiles = StringRegExp($sOutput, "[\s\*]*([\s\w\d\!\@\#\$\%\^\&\(\)\-\=\_\+\/\`\~\'\;\,\.]+):[\s]*([\d\%]+)[\s]*\/[\s]*([\w\d\.]+),[\s]*([\w\d\.\/]+),[\s]*([\w\d]+)", $STR_REGEXPARRAYGLOBALMATCH) ;untested _Rclone_Read_Debug_Check("Files in Transfer", $aFiles) ConsoleWrite("Data Read: " & @CRLF & $sOutput & @CRLF) ConsoleWrite("EOF" & @CRLF & @CRLF) EndFunc ;==>_Rclone_Read Func _Rclone_Read_Debug_Check($sName, $aData, $iError = @error, $iExtended = @extended) ConsoleWrite("Checking data for " & $sName & @CRLF) Switch $iError Case 0 ConsoleWrite("Array is valid." & @CRLF) ConsoleWrite("Offset: " & $iExtended & @CRLF) _ArrayDisplay($aData) Case 1 ConsoleWrite("Array is invalid. No matches." & @CRLF) Case 2 ConsoleWrite("Bad pattern, array is invalid." & @CRLF) ConsoleWrite("Offset: " & $iExtended & @CRLF) EndSwitch ConsoleWrite("Checking data for " & $sName & " completed!" & @CRLF & @CRLF) EndFunc ;==>_Rclone_Read_Debug_Check1 point
-
Regex toolkit
Viszna reacted to BertKerkhof for a topic
I rewrote the program StringRegExpGui that is distributed with AutoIT3 and can be found in the \Examples\Helpfile folder. The RegExGui published today is a total remake and offers the following improvements: Examples Built-in and instant accessible with a menu. There are six instructional applications for finding names, phone numbers, dates, and the like. The direct and fast operation allows the user to take the lead in the little-practiced box of pattern recognition. Thanks FritsW. Daring All examples start with multiple finds that match the specified pattern. In addition, each match is immediately shown and dissected into parts. This is in contrast to software that starts with a single match or just the observation that a match has taken place. With the direct approach, the user jumps straight into the deep and can simplify the example as desired. This depth with RegExGui gives the best preparation for practical use. User-friendly On the screen is a ruler with numbers, so that an unexpected error in the manufacture of a pattern is now more quickly solved. Added are a number of tooltips. At will, the user can adjust and / or save the sample patterns. Growth The examples include links to sites that explain advanced regular expressions or provide tools. Furthermore, a link to a site for healthy food. Thanks JolandeS. The width of the dialog window of the program is adjustable. As patterns are better controlled, the user may want to go to long expressions. They can then remain completely in the picture. Thanks Melba23. Presentation Multiple results are presented in a two-dimensional way. Each match at the beginning of a line, optional decomposition of components in subsequent columns. As a result, a match will continue to be distinguished from a part that belongs to another match. The program now has a 256-bit icon with alpha transparency. Bright Textual explanations are given with the results. A lime background color is chosen for the status field. This improves the contrast. Thanks EmileR. Repair of errors A diagnosis has now been made regarding the exchange of detail - with primary match data in the results, when using the options Match and All matches. Until it is repaired, users can use the Match + detail and Ales Matches + details options. A bug in StringRegExpGui - the unexpected disappearance of all saved patterns - has been fixed. Thank LeaB. With RegExGUi, the patterns remain in the inifile in the same folder as the program. Happy Few users are aware of the invisibly different codings of the alphabet hidden under water in text files. Since the new millennium the use of unicode has been growing, it has many advantages. Here and there are 8 bit codings. They traversed searching in the past and especially finding it. Again without users knowing this, they have only experienced fruitlessness. The RegExGui presented here relieves the user for that matter in the whole. The program takes care of encoding and always comes up with the most complete results that fit your pattern, thanks DominiqueH. Efficient code Compared to the StringRegExpGui, the source code of RegExGui is shorter. Bert Kerkhof, analyst and programmer Download: https://github.com/BertKerkhof/RegExGui Please comment RegExGui.source.au31 point