Advertisement
BugFix

Datenaustausch

Jun 29th, 2015
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.02 KB | None | 0 0
  1. ; Skript 1  -- fragt Werte von Skript 2 ab
  2.  
  3. Global $pathData = '..PFAD\exchange.ini'  ; einfachste Form, da Auslesefunktionen existieren
  4. Global $fNewData = False
  5. Global $TimeCode = @HOUR & @MIN & @SEC & @MSEC
  6.  
  7. AdlibRegister('_Check')
  8.  
  9. ; Code
  10.  
  11. ; Mainloop
  12. While 1
  13.     If $fNewData Then
  14.         $fNewData = False
  15.         ; Daten auslesen mit IniRead($pathData, ...)
  16.     EndIf
  17.     ;  other Code
  18. WEnd
  19.  
  20. Func _Check()
  21.     Local $FileTimeCode = IniRead($pathData, 'check', 'timecode', '')
  22.     If $FileTimeCode <> '' And $FileTimeCode <> $TimeCode Then
  23.         $TimeCode = $FileTimeCode
  24.         $fNewData = True
  25.     EndIf
  26. EndFunc
  27.  
  28. ; ------------------------------------------------
  29.  
  30.  
  31.  
  32. ; Skript 2  -- setzt Werte für Skript 1
  33.  
  34. Global $pathData = '..PFAD\exchange.ini'
  35.  
  36. ; Code
  37. ; ....
  38. ; erst die Daten setzen
  39. IniWrite($pathData, 'data', 'irgendwas_1', 'wert')
  40. IniWrite($pathData, 'data', 'irgendwas_2', 'wert')
  41. ; und dann den Timecode
  42. IniWrite($pathData, 'check', 'timecode', @HOUR & @MIN & @SEC & @MSEC)
  43.  
  44. ; ------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement