Leaderboard
Popular Content
Showing content with the highest reputation on 06/26/2017 in all areas
-
And another way ... sooo classic #include <Array.au3> Local $aArray[6] = ["INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]", _ "INFO [07.06.2018 08:55:44] [main] MDU5 - Ver 5.1x", _ "INFO [07.06.2017 12:55:11] [main] Dummy String1", _ "INFO [07.06.2016 09:55:11] [main] Dummy String2", _ "INFO [07.06.2017 09:55:12] [main] Dummy String3", _ "INFO [07.06.2017 09:55:11] [main] Dummy String4"] _ArrayDisplay($aArray, "No sorted") _Sort($aArray) _ArrayDisplay($aArray, "Sorted") Func _Sort(ByRef $aArray) _ArrayColInsert($aArray, 1) For $i = 0 To UBound($aArray) - 1 $aArray[$i][1] = StringRegExpReplace($aArray[$i][0], '(\d{2})\.(\d{2})\.(\d{4})', "$3$2$1") Next _ArraySort($aArray, 0, 0, 0, 1) _ArrayColDelete($aArray, 1) EndFunc ;==>_Sort2 points
-
LoneWolf_2106, Danyfirex' code fails when tried with the array that I used in my script1 point
-
I may have misunderstood what you are trying to do, but using a regular expression and changing all the values with a single pass rather than your current thousands of separate replace actions should be thousands of times faster. Local $replacestring="\\New\\String\\" Local $string=FileRead("File.ext") Local $searchstring=StringSplit(FileRead("ListSearchString.txt"),"|") $string=StringRegExpReplace($string,"(X:\\f\\c\\g)\\[0-9a-f]{2}\\[0-9a-f]{2}\\(.+\.png)","\1" & $replacestring & "\2") FileWrite("NewFileReplaced.ext",$string) gives this result on your test data X:\f\c\g\New\String\a815f6f11e281e378d310393894b9da9.png X:\f\c\g\New\String\cc89671b7dcf1adad300145d27dd3f83.png X:\f\c\g\New\String\30459a904e7bce61a744e92772edcba0.png X:\f\c\g\New\String\efdb9d0d837858ce3a209775b8e07d66.png X:\f\c\g\New\String\b60b11095b84935cc069a1f997a7e5ad.png X:\f\c\g\New\String\2401d3834b4119790b76ff44d7397aab.png X:\f\c\g\New\String\890b5b9b02e5ec56ef6b8d6a542cb7fd.png X:\f\c\g\New\String\906f44428cc33593f008be47afb2288b.png X:\f\c\g\New\String\6bb5c9d6ed6e48db41863675b6b0937b.png X:\f\c\g\New\String\c39c341ad690cf76a090989f5b0e3e5b.png X:\f\c\g\New\String\dceac588a90e67d65f0b6e2fcb43b7ae.png X:\f\c\g\New\String\63affc4b4f13707042b45a2ccdf8882a.png X:\f\c\g\New\String\11b6ac483fb453ecbfeed25903740cc5.png X:\f\c\g\New\String\2b100ea9addad0cfc9193927ca8d211a.png X:\f\c\g\New\String\3726bd8892826dbc1c2fa1d859504ac7.png1 point
-
my text to audio converter
nacerbaaziz reacted to Jefrey for a topic
I like it how technology assists people needs. Also, I liked how you use lame to export SAPI onto wav/mp3 files. Very interesting! Would be happy to see this in github! Mods, could someone move this to the examples section?1 point -
Input mask
Angelo Júnior BR reacted to Deye for a topic
you are welcome Changes in the above example ! Now, if your first typed character is "(" it will autocomplete to "(00)00000-0000" else it will autocomplete to "000.000.000-00"1 point -
Input mask
Angelo Júnior BR reacted to Deye for a topic
Hi, How does this example work for you #include <GUIConstants.au3> #include <WinApi.au3> #include <String.au3> Global $hGUI, $idInput GUIRegisterMsg($WM_COMMAND, _WM_COMMAND) _Example() Func _Example() $hGUI = GUICreate("Example", 300, 150) $idInput = GUICtrlCreateInput("", 10, 10, 180, 25) GUICtrlSetFont(-1, 11) GUISetState(@SW_SHOW, $hGUI) While 1 Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd EndFunc ;==>_Example Func InputFormated() Local $s = GUICtrlRead($idInput) If Not StringRegExp($s, '^[\d\.\-\(\)]*$') Or StringLen($s) > 14 Then Return GUICtrlSetData($idInput, StringTrimRight(GUICtrlRead($idInput), 1)) If StringLeft($s, 1) = "(" Then If StringLen($s) = 3 Then GUICtrlSetData($idInput, $s & ")") If StringLen($s) = 9 Then GUICtrlSetData($idInput, $s & "-") Else If StringLen($s) = 3 Or StringLen($s) = 7 Then GUICtrlSetData($idInput, $s & ".") If StringLen($s) = 11 Then GUICtrlSetData($idInput, $s & "-") EndIf EndFunc ;==>InputFormated Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) If $hWnd = $hGUI And _WinAPI_HiWord($wParam) = $EN_CHANGE And _WinAPI_LoWord($wParam) = $idInput Then InputFormated() Return "GUI_RUNDEFMSG" EndFunc ;==>_WM_COMMAND1 point -
Autolt error
SkysLastChance reacted to Subz for a topic
It appears it's malware, delete/rename the file: %AppData%\Microsoft\Windows\svchost.exe, this file is trying to pass itself off as "C:\WIndows\System32\svchost.exe". Check the following for the path for a shortcut to: %AppData%\Microsoft\Windows\svchost.exe Click: Start » Run Type: %AppData%\Microsoft\Windows\Start Menu\Programs\Startup Click: Start » Run Type: %AllUsersProfile%\Microsoft\Windows\Start Menu\Programs\Startup If you find shortcuts in either directory, right click and check the target path and if it points to %AppData%\Microsoft\Windows\svchost.exe then delete the shortcut Registry "Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to re-install Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk." Click: Start » Run Type: Regedit Navigate and check values in: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Navigate and check values in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run Navigate and check values in: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run * Delete the "%AppData%\Microsoft\Windows\svchost.exe" value in the right hand pane if found, don't delete anything else unless you know what you're doing1 point -
_GUICtrlListView_GetSelectedIndices returns a string, even though the string is a number. The function _GUICtrlListView_GetItemTextString requires a number for the index you want to read from. If you change the line below you will see that it works correctly. ;~ $no = _GUICtrlListView_GetSelectedIndices($idListview) <<<<<<<<<<<<<< Original line $no = Number(_GUICtrlListView_GetSelectedIndices($idListview)) ; Modified line When you added and subtracted from that string, AutoIt converted the string to a number for you, there's no conversion done with the Windows API that's being used so you have to give it what it's expecting, in this case a number.1 point
-
_CheckInput() UDF
Cr42y-80M83 reacted to MrCreatoR for a topic
Hi all, This example script is demonstrate how you can see some tip-text in your Gui inputs (or other text-displaying controls) untill you type there somthing, if the control have no focus, and the input was "untouched", then the input is filled again with the default tip-text, untill you set the focus on it again (put the cursor to input field). Sounds complicated?! check the example, its will show you all (it's easy and usefull)... #include <GuiConstants.au3> Global $MARk_1 = 0 Global $DEFAULTINPUTDATA_1 = "Click and type something here..." Global $MARK_2 = 0 Global $DEFAULTINPUTDATA_2 = "Click here and type something..." Global $MARK_3 = 0 Global $DEFAULTINPUTDATA_3 = "And here to..." Global $NONEAACTIVECOLOR = 0x989898 $GUI = GUICreate("Check Inputs Demo", 280, 150) WinSetOnTop($GUI, "", 1) $Input_1 = GUICtrlCreateInput($DEFAULTINPUTDATA_1, 15, 20, 250, 20) GUICtrlSetColor(-1, $NONEAACTIVECOLOR) $Input_2 = GUICtrlCreateInput($DEFAULTINPUTDATA_2, 15, 60, 250, 20) GUICtrlSetColor(-1, $NONEAACTIVECOLOR) $Input_3 = GUICtrlCreateInput($DEFAULTINPUTDATA_3, 15, 100, 250, 20) GUICtrlSetColor(-1, $NONEAACTIVECOLOR) $ExitButton = GUICtrlCreateButton("Exit", 110, 125, 60, 20) GUICtrlSetState(-1, $GUI_DEFBUTTON) GUISetState() ControlFocus($Gui, "", $ExitButton) While 1 _CheckInput($GUI, $Input_1, "Click and type something here...", $DEFAULTINPUTDATA_1, $MARK_1) _CheckInput($GUI, $Input_2, "Click here and type something...", $DEFAULTINPUTDATA_2, $MARK_2) _CheckInput($GUI, $Input_3, "And here to...", $DEFAULTINPUTDATA_3, $MARK_3) Switch GUIGetMsg() Case $ExitButton, -3 Exit Case Else ;..... EndSwitch WEnd Func _CheckInput($hWnd, $ID, $InputDefText, ByRef $DefaultInputData, ByRef $Mark) If $Mark = 0 And $DefaultInputData = $InputDefText And _IsFocused($hWnd, $ID) Then $Mark = 1 GUICtrlSetData($ID, "") GUICtrlSetColor($ID, 0x000000) $DefaultInputData = "" Sleep(20) ElseIf $Mark = 1 And $DefaultInputData = "" And GUICtrlRead($ID) = "" And Not _IsFocused($hWnd, $ID) Then $Mark = 0 $DefaultInputData = $InputDefText GUICtrlSetData($ID, $DefaultInputData) GUICtrlSetColor($ID, $NONEAACTIVECOLOR) Sleep(20) EndIf EndFunc Func _IsFocused($hWnd, $nCID) Return ControlGetHandle($hWnd, '', $nCID) = ControlGetHandle($hWnd, '', ControlGetFocus($hWnd)) EndFunc1 point