Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 13:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



2 While Schleifen - Problem

Discussion on 2 While Schleifen - Problem within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Τits ⇒ ω's Avatar
 
elite*gold: 24
Join Date: Jul 2011
Posts: 609
Received Thanks: 832
2 While Schleifen - Problem

Abend epvp,

ich hab 2 GuiCreate Forms. $Form1 auf @SW_SHOW und $Form2 auf HIDE.

Damit $Form1 sich schließst und $Form2 sich öffnet wenn ich einen Button in $Form1 drücke, hab ichs so:

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button2
GUISetState(@SW_HIDE, $Form1)
GUISetState(@SW_SHOW, $Form2)
EndSwitch
WEnd



Ich brauche aber bei $Form2 noch eine andere While Schleife.
Wenn ich diese jedoch ans Ende von und $Form2 hänge, will die andere While Schleife nichtmehr. Wie kann ich das am besten lösen?

Danke schonmal!
Τits ⇒ ω is offline  
Old 12/24/2012, 23:30   #2
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
z. B. so

PHP Code:
#include <GUIConstants.au3>

$gui1 GUICreate("erstes fenster")
$button1 GUICtrlCreateButton("links"103510020)
$buttonklick1 GUICtrlCreateButton("klick"2503510020)

$gui2 GUICreate("schritt links")
$buttonklick2 GUICtrlCreateButton("klick"103510020)
$zurueck GUICtrlCreateButton("rechts"2503510020)

GUISetState(@SW_SHOW$gui1)

While 
1
    $msg 
GUIGetMsg(1)
    Switch 
$msg[1]
        Case 
$gui1
            
Switch $msg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$buttonklick1
                    MsgBox
(0"""gui1")
                Case 
$button1
                    GUISetState
(@SW_HIDE$gui1)
                    
GUISetState(@SW_SHOW$gui2)
            EndSwitch
        Case 
$gui2
            
Switch $msg[0]
                Case 
$GUI_EVENT_CLOSE
                    GUISetState
(@SW_SHOW$gui1)
                    
GUISetState(@SW_HIDE$gui2)
                Case 
$buttonklick2
                    MsgBox
(0"""gui2")
                Case 
$zurueck
                    GUISetState
(@SW_SHOW$gui1)
                    
GUISetState(@SW_HIDE$gui2)
            EndSwitch
    EndSwitch
WEnd 
omer36 is offline  
Old 12/24/2012, 23:59   #3
 
Τits ⇒ ω's Avatar
 
elite*gold: 24
Join Date: Jul 2011
Posts: 609
Received Thanks: 832
Quote:
Originally Posted by omer36 View Post
z. B. so

Funktioniert leider nicht ganz bei mir.
""Wend" statement with no matching "While" statement."

Ich versuch die beiden zusammen zu fassen:

Für $Form1:
PHP Code:
While 1
   $nMsg 
GUIGetMsg()
   Switch 
$nMsg
      
Case $GUI_EVENT_CLOSE
         
Exit
      Case 
$Button2
         GUISetState
(@SW_HIDE$Form1)
         
GUISetState(@SW_SHOW$Form2)
EndSwitch
WEnd 

Für $Form2:
PHP Code:
While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            $PH2 
0
            
do
            
$PH2 $PH2 10
            sleep
(800)
            
guictrlsetdata($Progress1 $PH2)
            
until $PH2 100
            sleep
(3000)
            
GUISetState()
    EndSwitch
WEnd 

Danke!
Τits ⇒ ω is offline  
Old 12/25/2012, 01:16   #4

 
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 854
Code:
While 1
   $nMsg = GUIGetMsg(1)
   Switch $nMsg[1]

	Case $Form1
      Case $GUI_EVENT_CLOSE
         Exit
      Case $Button2
         GUISetState(@SW_HIDE, $Form1)
         GUISetState(@SW_SHOW, $Form2)

	 Case $Form2
		  Case $GUI_EVENT_CLOSE
			Exit
			Case $Button1
            $PH2 = 0
            do
            $PH2 = $PH2 + 10
            sleep(800)
            guictrlsetdata($Progress1 , $PH2)
            until $PH2 = 100
            sleep(3000)
            GUISetState()
EndSwitch
WEnd
So dürfte es gehen.
BladeTiger12 is offline  
Old 12/25/2012, 01:23   #5
 
Τits ⇒ ω's Avatar
 
elite*gold: 24
Join Date: Jul 2011
Posts: 609
Received Thanks: 832
Quote:
Originally Posted by BladeTiger12 View Post

Geht leider nicht, beim Button von $Form1 passiert nichts mehr.
Τits ⇒ ω is offline  
Old 12/25/2012, 01:57   #6

 
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 854
Das volle script wäre schon .
BladeTiger12 is offline  
Old 12/25/2012, 03:04   #7
 
Τits ⇒ ω's Avatar
 
elite*gold: 24
Join Date: Jul 2011
Posts: 609
Received Thanks: 832
Quote:
Originally Posted by BladeTiger12 View Post
Das volle script wäre schon .
Kann ich dich auf Skype adden?
Τits ⇒ ω is offline  
Old 12/25/2012, 11:38   #8
 
omer36's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,317
Received Thanks: 1,255
PHP Code:
While 1
    $msg 
GUIGetMsg(1)
    Switch 
$msg[1]
        Case 
$Form1
            
Switch $msg[0]
              Case 
$GUI_EVENT_CLOSE
                 
Exit
              Case 
$Button2
                 GUISetState
(@SW_HIDE$Form1)
                 
GUISetState(@SW_SHOW$Form2)
            EndSwitch
        Case 
$Form2
            
Switch $msg[0]
                Case 
$GUI_EVENT_CLOSE
                    
Exit
                Case 
$Button1
                    $PH2 
0
                    
do
                    
$PH2 $PH2 10
                    sleep
(800)
                    
guictrlsetdata($Progress1 $PH2)
                    
until $PH2 100
                    sleep
(3000)
                    
GUISetState()
            EndSwitch
    EndSwitch
WEnd 
omer36 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
script problem mit for - next schleifen
10/02/2011 - AutoIt - 5 Replies
hi, wie schon im titel beschrieben wollte ich dich um hilfe bitten ich will die loop neustarten wenn die bestimmte farbe an der stelle eintritt wär nett wenn ihr mir helfen könntet die Fehlermeldung lautet func missi() Error:"For" statement has no matching "Next" statement
iniwrite & for-schleifen Problem
06/27/2011 - AutoIt - 5 Replies
Hallo epvpers, Ich ab mal ne frage; wie mach ich das wenn zwei Sachen, einmal aus einer Inputbox und einmal aus einer ini-datei nicht übereinstimmen dann eine neue Zeile in der ini angelegt wird(mit einem anderen Namen?) Ich habs mal so aber da passiert nichts: if not guictrlread($input5where)=IniRead(@WindowsDir& "\Teamspeak.ini", "Join", "Installpath", "") Then for $i=0 to 1 IniWrite(@WindowsDir&"\Teamspeak.ini ", "Join", "Installpath"&+1, GUICtrlRead($Input5where)) next
While Schleifen Problem
12/31/2010 - AutoIt - 24 Replies
Hi Com., ich habe einen Fritzbox ip changer geschrieben. Alles klappt wunderbar, nur macht mir die while schleife zu schaffen. Hier mein Script. #include <INet.au3>
Auto-Schleifen [Problem]
06/23/2010 - Off Topic - 10 Replies
Hallo, und zwar brauche ich Informationen über das Schleifen. Am besten wäre folgendes: Woher kommt das Schleifen? Wie schleift man richtig?
Exitloop Problem mit mehreren Schleifen
10/21/2009 - AutoIt - 5 Replies
Abend ! und zwar sieht mein Problem wie folgt aus: While 1=1 (das script) If...Then -hier ist das problem: ich möchte das das programm die while schleife sozusagen pausiert -dann das was gemacht werden soll



All times are GMT +1. The time now is 13:08.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.