Jump to content

Two while at the same time?


Recommended Posts

;;Update'as
        $update = GUICreate("Atnaujinama duomenų bazė...", 300, 130, -1, -1, $WS_BORDER, -1)
        $back3 = GUICtrlCreatePic ("newmark1.bmp", 0, 0, 300, 130)
        GuiCtrlSetState($back3, $GUI_DISABLE)
        GUISetState (@SW_SHOW)
        GUICtrlCreateGroup("Praome palaukti...", 10, 5, 275, 85)
        GUICtrlCreateGroup("", 30, 25, 235, 30)
        $nf = 40
        
        $informacija = GUICtrlCreateLabel("Jungiuosi prie serverio...", 0, 65, 300, 30, $SS_CENTER)
        GUICtrlSetColor($informacija, 0xFFFFFF)
        
        While 1
            
        ;;LoadingScreen

;;here's loading loop

            For $z = 1 To 11
            GUICtrlCreateLabel("|.=.|", $nf, 30, 200, 20)
            GUICtrlCreateLabel("|.=.|", $nf, 40, 200, 20)
            $nf = $nf + 20
            Sleep(420)
            Next
            $nf = $nf - 20
            For $z = 1 To 11
            $jk1 = GUICtrlCreateLabel("|.=.|", $nf, 30, 200, 20)
            $jk2 = GUICtrlCreateLabel("|.=.|", $nf, 40, 200, 20)
            GUICtrlSetColor($jk1, 0xFFFFFF)
            GUICtrlSetColor($jk2, 0xFFFFFF)
            $nf = $nf - 20
            Sleep(420)
            Next
            $nf = 40    
          ;;/LoadingScreen    
            
Wend






While 2
;;  Operations should go during loading loop 
            $ping = Ping("masterj.250free.com", 4000)
                
                If $ping Then
                GUICtrlSetData($informacija, "Jungiuosi prie serverio... (ping: " & $ping &"ms)")
                Sleep(360)
                Else
                GUICtrlSetData($informacija, "Jungiuosi prie serverio... (klaida: nėra susijungimo!)")
                ExitLoop
                EndIf

            If GUICtrlRead($informacija) = "Kraunu programą..." Or GUICtrlRead($informacija) = "Kraunu programą..." Then ExitLoop
        Wend
            
;;/Update'as

Edited by Marius
Marius back in da hood! :)
Link to post
Share on other sites

Why can't you have them in the same loop?

#include <GUIConstants.au3>

$update = GUICreate("Atnaujinama duomenu baze...", 300, 130, -1, -1, $WS_BORDER, -1)
$back3 = GUICtrlCreatePic("newmark1.bmp", 0, 0, 300, 130)
GUICtrlSetState($back3, $GUI_DISABLE)
GUISetState(@SW_SHOW)
GUICtrlCreateGroup("Praome palaukti...", 10, 5, 275, 85)
GUICtrlCreateGroup("", 30, 25, 235, 30)
$nf = 40
$informacija = GUICtrlCreateLabel("Jungiuosi prie serverio...", 0, 65, 300, 30, $SS_CENTER)
GUICtrlSetColor($informacija, 0xFFFFFF)

While 1
   For $z = 1 To 11
      GUICtrlCreateLabel("|.=.|", $nf, 30, 200, 20)
      GUICtrlCreateLabel("|.=.|", $nf, 40, 200, 20)
      $nf = $nf + 20
      Sleep(420)
   Next
   $nf = $nf - 20
   For $z = 1 To 11
      $jk1 = GUICtrlCreateLabel("|.=.|", $nf, 30, 200, 20)
      $jk2 = GUICtrlCreateLabel("|.=.|", $nf, 40, 200, 20)
      GUICtrlSetColor($jk1, 0xFFFFFF)
      GUICtrlSetColor($jk2, 0xFFFFFF)
      $nf = $nf - 20
      Sleep(420)
   Next
   $nf = 40
   $ping = Ping("masterj.250free.com", 4000)
   If $ping Then
      GUICtrlSetData($informacija, "Jungiuosi prie serverio... (ping: " & $ping & "ms)")
      Sleep(360)
   Else
      GUICtrlSetData($informacija, "Jungiuosi prie serverio... (klaida: nera susijungimo!)")
      ExitLoop
   EndIf
   If GUICtrlRead($informacija) = "Kraunu programa..." Then ExitLoop
WEnd

qq

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...