Leaderboard
Popular Content
Showing content with the highest reputation on 06/08/2020 in all areas
-
Something like this: #include <Array.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $sText = FileRead("C:\Users\User\Desktop\autoit\test2.txt") If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) Local $aWords = StringRegExp($sText, '[a-z]{7,}' ,$STR_REGEXPARRAYFULLMATCH) _ArrayDisplay($aWords) EndFunc1 point
-
Local $iMove = -4 $old = "G1 X45.036 Y6.934 F7800.000 G1 Z0.600 F7800.000 G1 F900 G1 X48.036 Y1.076 E0.58925" $new = Execute("'" & StringRegExpReplace($old, "(?<=X)\d+.\d+", "' & Execute('$0+' & $iMove) & '") & "'") Msgbox(0,"", $old & @crlf & $new)1 point
-
A cross-platform implementation of the AutoIt language
seadoggie01 reacted to TheDcoder for a topic
Hello everyone, Just a small but important update, as of today I have officially started work on the project, and I have chosen to name it EasyCodeIt There are a handful of reasons why I chose that name: It reflects one of the important goals, keeping it easy to code It somewhat makes sense and rhymes with AutoIt By far, it is the only name which hasn't been used by others (DuckDuckGo shows that no results contain that word) It is shorter than other potential names while still being meaningful ...there might be other reasons which I cannot recall right now If I come across a better name, I might change it still, so nothing is set in concrete. I am licensing the code under GPL (v3), a newer version of the same license under which AutoIt3 used to be under. I don't really have a problem with others forking my code, but I sure do not want the forks to be closed source, that is the reason why I did not choose a 100% free license. Eventually we would need exceptions down the road to allow binary distribution of executable without having to require disclosing their own source code. My current aim is to build a bare-minimum cross-platform interpreter which can act as a proof-of-concept, and we can build from there I will release the code publicly once I actually finish something presentable, right now my code is not very different than a simple imitation of command-line tools like cat or type1 point -
So why split the file line by line? Read the whole file and apply the regex on it.1 point
-
@mucitbey, in this forum we do not encourage resurrecting old topics, even if your issue does have some similarity to the original topic. in the future, unless you have something to contribute to a recently-active topic, please start a new topic. now, how about you try "shutdown.exe -i" and see how that works for you?1 point
-
doggy, Welcome to the AutoIt forums. StrinRegExp only works on strings, not whole arrays, so you will have to loop through the array and test each element. M231 point
-
Regex doesn't work on an Array but rather a String, so you need to loop through the array and test the one at the time. Jos1 point
-
Not sure... since I can't access the site. You could try something like this -- _WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//select[@name='rollback_bodi']/optgroup[1]/option[1]") P.S. Take a look at the ChroPath add-in.1 point
-
Add case else then add a for ... next loop Opt ( 'TrayMenuMode', 3 ) Local $iNumber = InputBox ( 'Test', 'Enter the number of tray icon menu items:' ) ; Request number of tray icon menu items from User Local $aItemLabels[$iNumber + 1] ; Create array to hold tray icon menu item labels Local $idMenuItem[$iNumber + 1] ; Create array to hold menu item handles For $iFoo = 1 to $iNumber ; Assign a label to each menu item $aItemLabels[$iFoo] = 'Item #' & String ( $iFoo ) ; Create label $idMenuItem[$iFoo] = TrayCreateItem ( $aItemLabels[$iFoo] ) ; Create handle Next ; End loop $idTrayExit = TrayCreateItem ( 'Exit' ) ; Create a way to gracefully exit While 1 ; Create loop to monitor actions taken on tray menu $iMsg = TrayGetMsg() ; Store actions taken on tray menu Switch $iMsg ; Do one of the following depending on actions taken Case $idTrayExit ; User clicked 'Exit'. Exit ; Exit ;Case $idMenuItem[x] ; How do I handle an unknown number of tray items? ; MsgBox ( 4096, 'Response', 'You clicked on ' & $aItemLabels[x] ) ; case Else for $tmp=1 to $iNumber if $iMsg=$IdMenuItem[$tmp] then MsgBox (0,"Trayitem",$tmp) Next EndSwitch ; WEnd1 point
-
Just use the FileInstall() function for that. Jos1 point
-
Non regex version: #include <StringConstants.au3> $data = '2020-06-08 09:23:33 : abcdefghifjklm' ConsoleWrite(StringStripWS(StringMid($data, 1 + StringInStr($data, ":", 0, -1)), BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING)) & @CRLF)1 point
-
Something like this?: $data = '2020-06-08 09:23:33 : abcdefghifjklm' $RightPart = StringRegExpReplace($data,".*:(.*?)","$1") ConsoleWrite(' $RightPart = ' & $RightPart & @CRLF) Jos1 point
-
have to think there is a regex solution to be had...something heading down the path of #Include <Array.au3> Local $a[2][2] = [[0,1],[10,20]] $s = StringRegExpReplace(_ArrayToString($a) , "(\d+)" , "\1 + 5") local $aNew[0][2] _ArrayAdd($aNew , $s) _ArrayDisplay($aNew)1 point