Leaderboard
Popular Content
Showing content with the highest reputation on 04/17/2021 in all areas
-
[solved] StringFormat(), where is the StringFormatBuilder() ?
seadoggie01 and 2 others reacted to jchd for a topic
That's simply because regexes (not only PCRE) are tools to match pieces of text but have no internal support for replacement, nor any other text processing. StringRegexReplace and similar features allow you to grab matched pieces from a subject and allow you to glue them verbatim at will, but there is no regex primitive to perform any transformation of the text pieces. Furthermore, even if PCRE offers built-in If-Then-Else and even recursive constructs, none of them is available in the "replace pattern": it isn't a regular regex pattern, just a string with interpolation of sequences similar to regex back-references: $1,$2,... or \1,\2,... or ...$(17),$(18),... This implies that applying any transformation to any piece of text output by the match phase has to be done by external code and --for a character translation-- a translation table in an external container, just as @mikell said. In Perl regex have support for Perl interpolation, that is invoke Perl code when certain matching condition occurs, but it's still code external to regex which will be acting then.3 points -
As there are multiple requirements I can't see how to avoid the use of an external container $sd = ObjCreate("Scripting.Dictionary") $sd.add("a", "e") $sd.add("o", "a") $sd.add("u", "a") $str = "Bread Whole Bull Ball" $r = Execute("'" & StringRegExpReplace($str, "(\w)", "' & ($sd.exists('$1') ? $sd.item('$1') : '$1') & '") & "'") Msgbox(0,"", $r) Edit : something simpler - but more limited $s = "Bread Whole Bull Ball" $in = "aou" $out = "eaa" $res = Execute('"' & StringRegExpReplace($s, '([aou])', '" & StringMid($out, StringInStr($in, "$1"), 1) & "') & '"') Msgbox(0,"", $res)3 points
-
Thanks Mikell, by simply changing Execute() to Consolewrite() I was able to see what that line of the first script does. Produces a single 851-character AutoIt instruction to parse every single letter of the input string. Brilliant and expensive at the same time; still interesting. so I can infer that there is no "internal" way to ask regexp to scan a sequence of characters and replace them with another set of substitutes. Thanks a lot @mikell, always something interesting from you. p.s. @argumentum, sorry for my little hijacking. I'm leaving right now ... bye2 points
-
PSPad4AutoIt3 (editor IDE)
x_bennY and one other reacted to Professor_Bernd for a topic
PSPad4AutoIt3 v2.0.0 beta (2021-04-16) The time has come, the famous version 2.0 is here! š In this case it's really a big version jump, PSPad4AutoIt3 (short: Pau3) has new features, many changes and improvements. Pau3 is now fully portable. As noted in a forum posting, (thanks for pointing it out) š it's not that special for the user, but it is for me. Because Pau3 is now independent of files outside its own folder. That means, for internal editor functions no more installing of additional programs is necessary and also no setup. - There is a zipped package, just unpack and go. š Of course you need AutoIt3 if you want to run or compile scripts! AutoIt3 is an external program, not included in the editor. If you don't have AutoIt3 installed, the DownloadHelper dialog helps: With a button click you can go to the AutoIt3 download web page or do a direct download. The download helper is called as soon as you start a function that requires AutoIt3, like "Run", "Compile", ... There is now a separate AutoIt3 menu in the main menu of PSPad. This makes it easier to find AutoIt related settings and functions. There you can find e.g. "Tips and Shortcuts", "Register file types" or a setting option for "Tidy for Au3" (currently only as direct editing of Tidy.ini). Your favorite tools and AutoIt Script commands, like "Run", "Compile", ... can be placed in the Favorites panel, where they are then easily accessible. The arrangement of the panel areas has been extended by Jan Fiala on my request, so that the Favorites as well as the CodeExplorer can be displayed in the right panel. You can now close the left panel completely and have more space for the code area and everything in view at the same time. Info Favorites and CodeExplorer Screenshots Shortcuts - The shortcuts are now set SciTE-like. Register file types - in the PSPad main menu: "AutoIt3" / "Settings (AutoIt3)" / "Register file types" Pau3 offers a dialog to register .au3 files very comfortable for PSPad. This gives you the possibility to open .au3 files in the explorer with a double click with PSPad. In addition, one can click "Open this script" in the AutoIt3 help to open the respective sample code directly with PSPad. If you had installed SciTE before registering the .au3 files, you can undo the registration completely with the same dialog. The .au3 files are then registered for SciTE again. About dialog - in PSPad main menu: "AutoIt3" / "Help" / "About PSPad4AutoIt3" There is now a nice about dialog in "90s style". There you can see version infos of the Improvement Kit Scripts and you can find links with contact possibilities which you can click on. Tidy for Au3 - an underestimated tool. Very useful e.g. if you open foreign code from the internet in the editor and press Alt+T => unreadable code has become well-formatted code. Or if you insert foreign code and tabs are used there, but you want only spaces in your code: press Alt+T, ... And don't worry, there is an undo function if you don't like the result. - Settings - Many users don't even know what all you can set for Tidy. For example, you can set the indentation width, that is, whether you want your code to be indented 2, 3, 4, or more spaces. If someone asks for it, I can add an automatic detection of the indentation width, which is based on the tab width. - Output - Tidy can be run either with or without an output of the result in the console (LogWin). - Backup folder - Tidy creates a backup file and a backup folder on each run. Many people find it annoying to find an additional backup folder in each script folder after using Tidy. Pau3 redirects the backups to a separate backup folder in the Pau3 folder. This keeps all script folders "clean". CallTipViewer - The CallTipViewer has now learned to recognize when the user writes an opening round bracket "(" after a function name, e.g. "MsgBox(". Then the CallTip is displayed automatically, independent of the keyboard layout. - With OUDFs there is a small tooltip when pressing the shortcut to show the CallTip and the script is not saved. Have fun trying it out, and remember the feedback Professor Bernd. Download in the german forum PSPad4AutoIt3 (Editor IDE), end of post #12 points -
Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
argumentum reacted to Jos for a topic
This isn't true as the properties files are merged into the PE Header as Embedded PROPERTIES, as you can see: and you can set any variable you choose in the properties for your own purpose as we have done with our setup. So I still am pretty sure that what I have explained before, is how things are working unless somebody can demonstrate otherwise. Jos1 point -
Nice find. Only one small issue. When clicking the menu, it does not close the context menu. Example() Func Example() Local $hWnd = WinGetHandle("[CLASS:SciTEWindow]") Local $hCtrl = ControlGetHandle($hWnd, "", "Scintilla1") _WinAPI_PostMessage($hWnd, $WM_CONTEXTMENU, $hCtrl, 0x00E000E0) Local $hContext = WinWait("[CLASS:#32768]") Local $hMenu = _SendMessage($hContext, $MN_GETHMENU) Local $iItem = _GUICtrlMenu_FindItem($hMenu, "Select All") Local $ItemID = _GUICtrlMenu_GetItemID($hMenu, $iItem) ConsoleWrite($ItemID & @CRLF) _SendMessage($hWnd, $WM_COMMAND, $ItemID, 0) WinClose($hContext) EndFunc Tested on standard menu, it works perfectly. No issue. So you should consider just adding context window handle as a parameter of your function.1 point
-
Uploaded a new version of the SciTE4AutoIt3.exe v21.316.1639.1
argumentum reacted to Jos for a topic
Ok, I think I understand your issue now: The setting is nicely changed in memory for the existing proces, but the new shelled instance of SciTE will check de properties files and still read the "check.if.already.open=1" setting, thus detect the other instance and close itself after having forwarded the info of the "file to open". This is a POC script that will open a new session by temporarily updating the SciTEUser.properties: $SciTE = "C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" $TestAu3 = "D:\temp\test.au3" $SciTEUserConfig = "C:\Users\jvdza\AppData\Local\AutoIt v3\SciTE\SciTEUser.Properties" $SciteConfigContent = FileRead($SciTEUserConfig) $rc=FileWrite($SciTEUserConfig ,@crlf & "check.if.already.open=0" & @CRLF) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $rc = ' & $rc & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Run($SciTE & " " & $TestAu3) FileRecycle($SciTEUserConfig) $rc=FileWrite($SciTEUserConfig ,$SciteConfigContent) Jos1 point -
Send("{ENTER}") is sending window Class Name
Nine reacted to JockoDundee for a topic
Iām getting Error - Source File Not Found every time I try to run the darn thing1 point -
[solved] StringFormat(), where is the StringFormatBuilder() ?
wolflake reacted to argumentum for a topic
@seadoggie01, I can understand quantum entanglement, the reason for matter to exist, etc., but this darn Regular Expressions I have no clue. A string in a variable is just a string.1 point -
Send("{ENTER}") is sending window Class Name
JockoDundee reacted to Nine for a topic
You better check line 41, you have a badly formatted function there...1 point -
Improving _ArrayDisplay speed
pixelsearch reacted to LarsJ for a topic
Here is the virtual listview with sort indexes. You can choose from 10,000 - 100,000 rows in the combobox. There are two examples. In ArrayDisplay.au3, the sorting is performed on the fly when you click the column header. But the index is saved. The next time you click the same column header, the index doesn't need to be calculated again. In ArrayDisplay2.au3, sorting of all columns is performed in advance when you select a row number in the combobox. This is ArrayDisplay2.au3 on Windows 10: Time measurements in ArrayDisplay2.au3 on Windows 7 and Windows 10. Windows 7: $iRows = 10000 Generating array = 358.781013572459 Sorting array by column 0 Sorting array = 725.168987383328 Sorting array by column 1 Sorting array = 691.547153983459 Sorting array by column 2 Sorting array = 674.460721151355 Sorting array by column 3 Sorting array = 712.971753847876 Sorting array by column 4 Sorting array = 669.573738173515 $iRows = 20000 Generating array = 740.15795150085 Sorting array by column 0 Sorting array = 1573.40517161372 Sorting array by column 1 Sorting array = 1483.93515161976 Sorting array by column 2 Sorting array = 1450.29254023103 Sorting array by column 3 Sorting array = 1596.44574493107 Sorting array by column 4 Sorting array = 1457.82719306824 Displaying array $iRows = 30000 Generating array = 1112.6809728199 Sorting array by column 0 Sorting array = 2482.22581573692 Sorting array by column 1 Sorting array = 2342.03367751841 Sorting array by column 2 Sorting array = 2292.68983255434 Sorting array by column 3 Sorting array = 2564.00964209499 Sorting array by column 4 Sorting array = 2300.08984402379 Displaying array $iRows = 40000 Generating array = 1467.92280229134 Sorting array by column 0 Sorting array = 3421.94277520238 Sorting array by column 1 Sorting array = 3227.61289443203 Sorting array by column 2 Sorting array = 3173.90594884902 Sorting array by column 3 Sorting array = 3585.83262526565 Sorting array by column 4 Sorting array = 3179.76118610734 Displaying array $iRows = 50000 Generating array = 1850.58769848866 Sorting array by column 0 Sorting array = 4419.27792887224 Sorting array by column 1 Sorting array = 4162.76700754573 Sorting array by column 2 Sorting array = 4038.98393972278 Sorting array by column 3 Sorting array = 4644.78587451369 Sorting array by column 4 Sorting array = 4123.59412664434 Displaying array $iRows = 60000 Generating array = 2133.9393487735 Sorting array by column 0 Sorting array = 5399.97794762783 Sorting array by column 1 Sorting array = 5083.85636148603 Sorting array by column 2 Sorting array = 4944.67929728288 Sorting array by column 3 Sorting array = 5747.94969732011 Sorting array by column 4 Sorting array = 5037.79626988003 Displaying array $iRows = 70000 Generating array = 2445.89702594949 Sorting array by column 0 Sorting array = 6429.4995912277 Sorting array by column 1 Sorting array = 6034.70311993969 Sorting array by column 2 Sorting array = 5900.32909563942 Sorting array by column 3 Sorting array = 6903.26765734271 Sorting array by column 4 Sorting array = 6027.34937412542 Displaying array $iRows = 80000 Generating array = 2805.65848355588 Sorting array by column 0 Sorting array = 7468.49128806631 Sorting array by column 1 Sorting array = 7060.91469139561 Sorting array by column 2 Sorting array = 6864.93254495179 Sorting array by column 3 Sorting array = 8110.69459708571 Sorting array by column 4 Sorting array = 6996.29736238669 Displaying array $iRows = 90000 Generating array = 3159.49876841934 Sorting array by column 0 Sorting array = 8534.18796433611 Sorting array by column 1 Sorting array = 8005.49702473052 Sorting array by column 2 Sorting array = 7811.69684415594 Sorting array by column 3 Sorting array = 9256.5217258807 Sorting array by column 4 Sorting array = 8016.83709696589 Displaying array $iRows = 100000 Generating array = 3479.57703771814 Sorting array by column 0 Sorting array = 9648.39958233472 Sorting array by column 1 Sorting array = 9036.15148428256 Sorting array by column 2 Sorting array = 8904.49328164509 Sorting array by column 3 Sorting array = 10498.6470758859 Sorting array by column 4 Sorting array = 9075.35483956761 Displaying array Windows 10: $iRows = 10000 Generating array = 469.5655 Sorting array by column 0 Sorting array = 1047.509 Sorting array by column 1 Sorting array = 1004.8089 Sorting array by column 2 Sorting array = 942.9591 Sorting array by column 3 Sorting array = 1002.2672 Sorting array by column 4 Sorting array = 951.8781 $iRows = 20000 Generating array = 916.4006 Sorting array by column 0 Sorting array = 2061.4822 Sorting array by column 1 Sorting array = 1992.4709 Sorting array by column 2 Sorting array = 1924.7481 Sorting array by column 3 Sorting array = 2127.4384 Sorting array by column 4 Sorting array = 1936.3358 Displaying array $iRows = 30000 Generating array = 1372.8649 Sorting array by column 0 Sorting array = 3244.5609 Sorting array by column 1 Sorting array = 3180.6722 Sorting array by column 2 Sorting array = 3092.1707 Sorting array by column 3 Sorting array = 3382.2133 Sorting array by column 4 Sorting array = 3058.7045 Displaying array $iRows = 40000 Generating array = 1856.9411 Sorting array by column 0 Sorting array = 4525.1955 Sorting array by column 1 Sorting array = 4296.5849 Sorting array by column 2 Sorting array = 4182.7308 Sorting array by column 3 Sorting array = 4746.0117 Sorting array by column 4 Sorting array = 4244.3555 Displaying array $iRows = 50000 Generating array = 2382.5111 Sorting array by column 0 Sorting array = 5770.5723 Sorting array by column 1 Sorting array = 5710.5163 Sorting array by column 2 Sorting array = 6483.6553 Sorting array by column 3 Sorting array = 7055.8409 Sorting array by column 4 Sorting array = 6588.6965 Displaying array $iRows = 60000 Generating array = 2751.5795 Sorting array by column 0 Sorting array = 7473.5253 Sorting array by column 1 Sorting array = 6755.4111 Sorting array by column 2 Sorting array = 6581.2973 Sorting array by column 3 Sorting array = 7716.1906 Sorting array by column 4 Sorting array = 6670.898 Displaying array $iRows = 70000 Generating array = 3159.6544 Sorting array by column 0 Sorting array = 8270.8446 Sorting array by column 1 Sorting array = 7956.5928 Sorting array by column 2 Sorting array = 7698.139 Sorting array by column 3 Sorting array = 8988.3115 Sorting array by column 4 Sorting array = 7851.209 Displaying array $iRows = 80000 Generating array = 3610.7372 Sorting array by column 0 Sorting array = 9663.0729 Sorting array by column 1 Sorting array = 9416.2116 Sorting array by column 2 Sorting array = 9397.7431 Sorting array by column 3 Sorting array = 10748.4111 Sorting array by column 4 Sorting array = 9382.0706 Displaying array $iRows = 90000 Generating array = 4181.5457 Sorting array by column 0 Sorting array = 11512.0692 Sorting array by column 1 Sorting array = 10848.8297 Sorting array by column 2 Sorting array = 10596.1946 Sorting array by column 3 Sorting array = 12445.5149 Sorting array by column 4 Sorting array = 10686.9957 Displaying array $iRows = 100000 Generating array = 4784.8767 Sorting array by column 0 Sorting array = 12814.0628 Sorting array by column 1 Sorting array = 12111.9869 Sorting array by column 2 Sorting array = 11753.6472 Sorting array by column 3 Sorting array = 14061.7319 Sorting array by column 4 Sorting array = 12092.2128 Displaying array Most of the code is copied from Data display functions. That's a lot of code. And it isn't mainstream code. ArrayDisplay.7z1 point -
How to prepare cache for a Virtual ListView
pixelsearch reacted to FrancescoDiMuro for a topic
@LarsJ Little Update: I found what were causing the Virtual ListView to not be created. I'm digging a little bit more to understand how to "free" the cache now, since I think ( as a non-expert I am ), the cache has to be free after some work with it. I want to thank you to poiting me to the right direction, and I'd like to let everyone knows, that your help made me happier, 'cause from your help, I ( almost, I miss few things ) understood how Virtual ListView can be created, and this is amazing, since, from now on, I can use them, and they're really powerful. So, I said all these stuffs because I want to spur everyone that help people is amazing, and it gives back ( hopefully ),a good result, both phisycal and moral. I hope you got this Have a wonderful day. Best Regards.1 point -
1 point