1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. detrauti

Beiträge von detrauti

  • Loops wiederholen und unterbrechen

    • detrauti
    • 29. März 2017 um 12:29

    Danke für die Tips. Ich habe versucht sie umzusetzen. Wie ich die GUIs mit den Befehlen aus und einblenden unterscheiden kann verstehe ich aber nicht. Micha_he: vlt kannst du mir da noch einen weiteren Tip geben

    Nun also noch einmal das angepasste Skript

    C
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    
    
    Global $Counter
    Global $Limit = 3
    Global $Button1
    
    
    While 2
    _Auftrag_Starten()
    $Counter	=0
    Beep ( 500, 200)
      ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF)								;~ programm check
       While 1
    	  Sleep(2000)
    	  ConsoleWrite("---------------the current hour is:"&@HOUR&"----------------------------"&@CRLF)								;~ programm check
    	  $Date1					= @YEAR&":"&@MON&":"&@MDAY																				;~ setting variable $Date1 [yyyymmdd]
    	  $StartTime1			= @HOUR*3600+@MIN*60+@SEC																				;~ setting variable $StartTime1 [hhmmss
    	  $Counter+=1
    	  ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF)								;~ programm check
       If $Limit=$Counter Then
    	  _Auftrag_Fertig()
    		 EndIf
       If $Button1 Then
    	  ExitLoop
    		 EndIf
    	  WEnd
       WEnd
    
    
    Func _Auftrag_Starten()
    #Region ### START Koda GUI section ### Form=D:\detrauti\Desktop\FAUF-Fertig.kxf
    $Form1 		= GUICreate("Form2", 615, 438, 192, 124)
    $TextBox1_1	= GUICtrlCreateLabel("neuer Auftrag Starten", 64, 48, 380, 49)
    GUICtrlSetFont(-1, 30, 400, 0, "Arial")
    $Button1Start = GUICtrlCreateButton("Start", 144, 216, 145, 97)
    GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")
    $TextBox1_2 = GUICtrlCreateLabel("Bereit?", 68, 144, 129, 49)
    GUICtrlSetFont(-1, 30, 400, 0, "Arial")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    
    
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    	  Case $GUI_EVENT_CLOSE
    		Exit
    	  Case $Button1Start
    		GUISetState(@SW_HIDE)
    		ExitLoop
    	EndSwitch
     WEnd
     EndFunc
    
    
    Func _Auftrag_Fertig()
    #Region ### START Koda GUI section ### Form=
    $Form2 		= GUICreate("Form1", 500, 300, 469, 41, BitOR($WS_SYSMENU,$WS_POPUP))
    $TextBox2_1	= GUICtrlCreateLabel("Stückzahl erreicht", 64, 48, 316, 49)
    GUICtrlSetFont(-1, 30, 400, 0, "Arial")
    $Button1 = GUICtrlCreateButton("JA", 144, 216, 145, 97)
    GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")
    $TextBox2_2 = GUICtrlCreateLabel("Arbeitsauftrag fertig?", 68, 144, 370, 49)
    GUICtrlSetFont(-1, 30, 400, 0, "Arial")
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    
    
    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
    	  Case $GUI_EVENT_CLOSE
    		Exit
    	  Case $Button1
    		 GUISetState(@SW_HIDE)
    		 ExitLoop
    	EndSwitch
     WEnd
     EndFunc
    Alles anzeigen
  • Loops wiederholen und unterbrechen

    • detrauti
    • 29. März 2017 um 10:02

    Hallo Zusammen,

    ich möchte folgendes Programm immer wieder wie folgt laufen lassen:
    -Auftrag (laden und) bestätigen
    -bis zum Limit zählen
    -Fragen ob der Auftrag fertig ist ===> Hier soll im Hintergrund aber trotzdem weiter gezählt werden (im Falle von Ausschuss muss die Stückzahl erreicht werden) [Problem 1]
    -Bei Bestätigung des erreichten Limits soll man wieder an den Anfang zurück kehren und das ganze wiederholt sich

    Hier ist mein nicht funktionierendes Skript

    AutoIt
    #include <GUIConstantsEx.au3> #include <WindowsConstants.au3>
    
    
    Global $CounterGlobal $Limit = 3Global $Button1
    
    
    While 2_Auftrag_Starten()$Counter    =0Beep ( 500, 200)  ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF)                                ;~ programm checkWhile 1    Sleep(2000)
    
    
          ConsoleWrite("---------------the current hour is:"&@HOUR&"----------------------------"&@CRLF)                                ;~ programm check     $Date1                    = @YEAR&":"&@MON&":"&@MDAY                                                                                ;~ setting variable $Date1 [yyyymmdd]     $StartTime1            = @HOUR*3600+@MIN*60+@SEC                                                                                ;~ setting variable $StartTime1 [hhmmss      $Counter+=1      ConsoleWrite("---------------the current number is:"&$Counter&"----------------------------"&@CRLF)                                ;~ programm check      If $Limit=$Counter Then         _Auftrag_Fertig()      EndIf      If $Button1 Then         ExitLoop         EndIf      WEnd   WEnd
    
    
       Func _Auftrag_Starten()      #include <ButtonConstants.au3>#include <GUIConstantsEx.au3>#include <StaticConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=D:\detrauti\Desktop\FAUF-Fertig.kxf$Form1 = GUICreate("Form2", 615, 438, 192, 124)$limit = GUICtrlCreateLabel("neuer Auftrag Starten", 64, 48, 380, 49)GUICtrlSetFont(-1, 30, 400, 0, "Arial")$Button1Start = GUICtrlCreateButton("Start", 144, 216, 145, 97)GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")$Label1 = GUICtrlCreateLabel("Bereit?", 68, 144, 129, 49)GUICtrlSetFont(-1, 30, 400, 0, "Arial")GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###
    
    
    While 1    $nMsg = GUIGetMsg()    Switch $nMsg    Case $GUI_EVENT_CLOSE            Exit         Case $Button1Start            GUISetState(@SW_HIDE)            ExitLoop    EndSwitch WEnd EndFunc
    
    
    
    
        Func _Auftrag_Fertig()      #include <ButtonConstants.au3>#include <GUIConstantsEx.au3>#include <StaticConstants.au3>#include <WindowsConstants.au3>#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Form1", 500, 300, 469, 41, BitOR($WS_SYSMENU,$WS_POPUP))$limit = GUICtrlCreateLabel("Stückzahl erreicht", 64, 48, 316, 49)GUICtrlSetFont(-1, 30, 400, 0, "Arial")$Button1 = GUICtrlCreateButton("JA", 144, 216, 145, 97)GUICtrlSetFont(-1, 30, 800, 0, "Arial Narrow")$Label1 = GUICtrlCreateLabel("Arbeitsauftrag fertig?", 68, 144, 370, 49)GUICtrlSetFont(-1, 30, 400, 0, "Arial")GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###
    
    
    While 1    $nMsg = GUIGetMsg()    Switch $nMsg        Case $GUI_EVENT_CLOSE            Exit         Case $Button1            GUISetState(@SW_HIDE)            ExitLoop    EndSwitch WEnd EndFunc
    Alles anzeigen

    Vielen Dank für die Hilfe

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™