Advertisement
untoha

clip_difference.au3

Mar 21st, 2018
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.66 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <EditConstants.au3>
  3. #include <GUIConstantsEx.au3>
  4. #include <StaticConstants.au3>
  5. #include <WindowsConstants.au3>
  6. #include <AutoItConstants.au3>
  7.  
  8. #Region ### START Koda GUI section ### Form=
  9. $Form1 = GUICreate("RoM .db difference", 623, 110, 192, 114, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
  10. $Input1 = GUICtrlCreateInput("", 8, 8, 609, 21)
  11. $Input2 = GUICtrlCreateInput("", 8, 32, 609, 21)
  12. $GO = GUICtrlCreateButton("GO", 8, 56, 75, 25)
  13. $dif = GUICtrlCreateLabel("differences:", 8, 88, 59, 17)
  14. $result = GUICtrlCreateLabel("0", 72, 88, 10, 17)
  15. GUISetState(@SW_SHOW)
  16. #EndRegion ### END Koda GUI section ###
  17.  
  18. HotKeySet("{F1}", "set1")
  19. HotKeySet("{F2}", "set2")
  20. HotKeySet("{ESC}", "nulll")
  21.  
  22. While 1
  23.     $nMsg = GUIGetMsg()
  24.     Switch $nMsg
  25.         Case $GUI_EVENT_CLOSE
  26.             Exit
  27.  
  28.         Case $GO
  29.            doo();
  30.     EndSwitch
  31.  WEnd
  32.  
  33. Func doo()
  34.    local $str1 = StringSplit(ControlGetText($Form1, "", $Input1), "#@|@#")
  35.    local $str2 = StringSplit(ControlGetText($Form1, "", $Input2), "#@|@#")
  36.    local $ress = 0;
  37.  
  38.    if $str1[0] <> $str2[0] then
  39.       ControlSetText($Form1, "", $result, "length not equal")
  40.    Else
  41.       For $i = 1 To UBound($str1)-1
  42.          ;ConsoleWrite($str1[$i]&" - "&$str2[$i] & @LF );
  43.          if $str1[$i] <> $str2[$i] Then
  44.             $ress = $ress + 1;
  45.          EndIf
  46.       Next
  47.    EndIf
  48.    ControlSetText($Form1, "", $result, $ress)
  49.    WinActivate("[CLASS:AutoIt v3 GUI]");
  50. EndFunc
  51.  
  52. Func set1()
  53.    Send("^c")
  54.    Sleep(200)
  55.    ControlSetText($Form1, "", $Input1, ClipGet())
  56.    doo();
  57. EndFunc
  58.  
  59. Func set2()
  60.    Send("^c")
  61.    Sleep(200)
  62.    ControlSetText($Form1, "", $Input2, ClipGet())
  63.    doo();
  64. EndFunc
  65.  
  66. Func nulll()
  67. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement