Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/20/2020 in all areas

  1. Thanks, this variant obviously works too. Yeah, it' s understandable to me. Now that I read it, it's relatively obvious .
    1 point
  2. I know why but I'm not sure I can explain it in a way that others can understand. You had 2 capture groups, let's call them G1 & G2. In general, when the regex engine finds a match, it will stop processing the rest of that match. So when it found a "lat" it put that value in the array and stopped processing. When it was on a "lon" line, It looked for G1 but didn't find it, so it put a blank in the array and then it went on to look for that alternate match ("lon") on that line and put it in the array. So as you can see below, every "lon" line had an empty G1 entry. I hope I was able to explain it in a way that was understandable. Regex: <lat>(.+)<\/lat>|<lon>(.+)<\/lon> G1 G2 <lat>10.0</lat> 10.0 stopped <lon>1.10</lon> blank 1.10 <lat>20.0</lat> 20.0 stopped <lon>2.20</lon> blank 2.20 <lat>40.0</lat> 40.0 stopped <lon>4.40</lon> blank 4.40
    1 point
  3. What about $aLatLon = StringRegExp($XMLString, '>(\d.*)<', 3) ?
    1 point
  4. Yes, I only used an * because I didn't know exactly what you wanted in your result set, all lat/lon or just ones with values.
    1 point
  5. Here's one of many ways that it could be done: #include <Array.au3> Local $aLat, $aLon, $aLatLon Local $XMLString = _ "<lat>10.0</lat>" & @CRLF & _ "<lon>1.10</lon>" & @CRLF & _ "<lat>20.0</lat>" & @CRLF & _ "<lon>2.20</lon>" & @CRLF & _ "<lat></lat>" & @CRLF & _ "<lon></lon>" & @CRLF & _ "<lat>40.0</lat>" & @CRLF & _ "<lon>4.40</lon>" $aLat = StringRegExp($XMLString, '<lat>([^<]*)' , 3) $aLon = StringRegExp($XMLString, '<lon>([^<]*)' , 3) $aLatLon = StringRegExp($XMLString, '<(?:lat|lon)>([^<]*)', 3) _ArrayDisplay($aLat, '$aLat') _ArrayDisplay($aLon, '$aLon') _ArrayDisplay($aLatLon, '$aLatLon')
    1 point
  6. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() #Region ### START Koda GUI section ### Form= Local $Form1 = GUICreate("Form1", 335, 84) Local $Input1 = GUICtrlCreateInput("Input1 ' """, 8, 8, 121, 21) Local $Button1 = GUICtrlCreateButton("Button1", 136, 8, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $Button1 ConsoleWrite('Global $var = "' & StringReplace(GUICtrlRead($Input1), '"', '""') & '"' & @CRLF) MsgBox(0, "", GUICtrlRead($Input1) & @CR & _ 'Global $var = "' & StringReplace(GUICtrlRead($Input1), '"', '""') & '"', 60, $Form1) EndSwitch WEnd EndFunc ;==>Example
    1 point
  7. @nooneclose I know this can be done with Firefox (see the Wiki FAQ section, but I don't recall if this can be accomplished with Chromium-based browsers.
    1 point
  8. #include <Misc.au3> While 1 If _IsPressed("1B") Then Exit ; 1B ESC key If _IsPressed("10") Then ; 10 SHIFT key ToolTip("- ON -") Else ToolTip("- OFF -") EndIf Sleep(100) WEnd ..it should work. Add the Sleep(100) or more. You're going too fast in your loop.
    1 point
  9. To @careca's point, technically the file move operation between volumes is a copy from source, then a deletion from source after the copy. Not sure how important that detail is as far as accomplishing the goal of moving a file, but I suppose it's useful to know how it works. Also, due to the nature of how it works, I would expect that there is some sort of successful copy validation already inherent in the process before it deletes the original, otherwise if the move didn't actually copy the file accurately and deleted the original you'd be at risk of losing integrity of the file data and be screwed. If you are really worried about it, perhaps perform the copy yourself, compare the two files, then delete the original. If I was worried checking a transferred file I might employ something to verify integrity more precisely than file sizes (i.e. a hash/checksum comparison).
    1 point
  10. mLipok

    @FuncName ?

    Recent change in Au3Stripper /rsln .... releated to @ScriptLineNumber is enought replacement for @FuncName. @FuncName will be uselles when you use Au3Stripper with /RM but @ScriptLineNumber will still fit the needs.
    1 point
  11. v0.2.0.9 just released with the following changes -- - Changed: _WD_Status now returns Dictionary object instead of raw JSON string - Changed: Add support for DebugTrim option to _WD_Option - Changed: Remove check for $HTTP_STATUS_SERVER_ERROR (chromedriver relic) - Changed: Improved output from _WD_IsLatestRelease - Fixed: Default arguments for _WD_ExecuteScript should be empty string - Fixed: Removed unneeded string conversion - Added: Generic error detection routine All primary functions will now detect additional errors, such as Invalid Session ($WD_InvalidSession) P.S. Let me know if you encounter any issues with the generic error checking routine I added.
    1 point
  12. 1 point
  13. Hello Danp2, i have a question. Has you has ever sent the {enter} key in the element? Please show me. (I know it is related to _WD_ElementAction)
    1 point
  14. billshu

    Setting Zoom in Chrome

    I use the following function to set the Zoom Level in Chrome. I just send a bunch of zoom downs then zoom up to the desired zoom level. It works great, but now i am running multi instantances of Chrome at the same time. All Chrome windows are affected by this function. Is there an easy way to set zoom in only one instance of Chrome Func SetZoom($LocalZoom) ;Chrome Zoom levels are: 25, 33, 50, 67, 75, 90, 100 sleep(3000) WinActivate($MyWindowHandle) sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) send("^-") sleep(200) ; Zoom should now be 25 If $LocalZoom > 32 Then Send("^{+}") ; Zoom Level is now 33 sleep(200) EndIf If $LocalZoom > 49 Then Send("^{+}") ; Zoom Level is now 50 sleep(200) EndIf If $LocalZoom > 66 Then Send("^{+}") ; Zoom Level is now 67 sleep(200) EndIf If $LocalZoom > 74 Then Send("^{+}") ; Zoom Level is now 75 sleep(200) EndIf If $LocalZoom > 89 Then Send("^{+}") ; Zoom Level is now 90 sleep(200) EndIf If $LocalZoom > 99 Then Send("^{+}") ; Zoom Level is now 100 sleep(200) EndIf Sleep(1500) Return(1) EndFunc
    1 point
  15. hi guys, i hope i have posted in right place in the future autoit it can become multithread ?
    0 points
×
×
  • Create New...