Jump to content
Sign in to follow this  
Marius

Two while at the same time?

Recommended Posts

Marius

Hello all! :)

Have problem here... I need TWO while at the same time. Any ideas?


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
buzz44

On what condition's do you want them to loop? Obviously there both not going to be While 1 because then you wouldn't need two.


qq

Share this post


Link to post
Share on other sites
Marius

I made a endless loop of images. And during those images loop I need few other operations to work.


Marius back in da hood! :)

Share this post


Link to post
Share on other sites
buzz44

Ok... Not sure what you mean but maybe AdlibEnable() will help you.

Edited by Burrup

qq

Share this post


Link to post
Share on other sites
Marius

;;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! :)

Share this post


Link to post
Share on other sites
buzz44

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

Share this post


Link to post
Share on other sites
seandisanti

;;  Operations should go during loading loop

<{POST_SNAPBACK}>

if they should go during loading loop... why not have them go during loading loop?

Share this post


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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.