Jump to content
Sign in to follow this  
Gif

controls as loop exists

Recommended Posts

Gif

im having difficulties on using controls when a loop exists

example:

While @InetGetActive
ToolTip("Downloading", 0, 0, "Info")
$nmsg = GUIGetMsg()
Select
Case $nmsg = $b_cansel
If @InetGetActive Then
InetGet("abort")
ToolTip("")
Else
Sleep(10)
EndIf
Case $nmsg = $GUI_EVENT_CLOSE
InetGet("abort")
Exit
EndSelect
WEnd
ToolTip("")

the problem is that the buttons dont work and the loop continues again and again without the buttons working

i also tryed putting the buttons out of the loop and using exitloop but again it doesnt work..

any help would be appreciated..

EDIT:cmn its a noob question

Edited by c4nm7

Share this post


Link to post
Share on other sites
Gif

im having difficulties on using controls when a loop exists

example:

While @InetGetActive
ToolTip("Downloading", 0, 0, "Info")
$nmsg = GUIGetMsg()
Select
Case $nmsg = $b_cansel
If @InetGetActive Then
InetGet("abort")
ToolTip("")
Else
Sleep(10)
EndIf
Case $nmsg = $GUI_EVENT_CLOSE
InetGet("abort")
Exit
EndSelect
WEnd
ToolTip("")

the problem is that the buttons dont work and the loop continues again and again without the buttons working

i also tryed putting the buttons out of the loop and using exitloop but again it doesnt work..

any help would be appreciated..

EDIT:cmn its a noob question

and i thought that this is toooo easy to be answered....

Share this post


Link to post
Share on other sites
BrettF

and i thought that this is toooo easy to be answered....

No.... you havn't given it a chance.

Maybe??

While 1
    ToolTip("Downloading", 0, 0, "Info")
    $nmsg = GUIGetMsg()
    Select
        Case $nmsg = $b_cansel
            If @InetGetActive Then
                InetGet("abort")
                ToolTip("")
            Else
                Sleep(10)
            EndIf
        Case $nmsg = $GUI_EVENT_CLOSE
            InetGet("abort")
            Exit
        Case Not @InetGetActive
            ExitLoop
    EndSelect
WEnd
ToolTip("")

I don't know much without a full GUI to test with though...

Share this post


Link to post
Share on other sites
Gif

I don't know about network thing but maybe you can try it this way?

While @InetGetActive
Do
ToolTip("Downloading", 0, 0, "Info")
$nmsg = GUIGetMsg()
Select
Case $nmsg = $b_cansel
If @InetGetActive Then
InetGet("abort")
ToolTip("")
Else
Sleep(10)
EndIf
EndSelect
Until $nmsg = $GUI_EVENT_CLOSE
WEnd
ToolTip("")
well this is what i want(and the problem is not about networking is about loops in general),

Share this post


Link to post
Share on other sites
Gif

While 1

ToolTip("Downloading", 0, 0, "Info")

$nmsg = GUIGetMsg()

Select

Case $nmsg = $b_cansel

If @InetGetActive Then

InetGet("abort")

ToolTip("")

Else

Sleep(10)

EndIf

Case $nmsg = $GUI_EVENT_CLOSE

InetGet("abort")

Exit

Case Not @InetGetActive

ExitLoop

EndSelect

WEnd

ToolTip("")

ok it works but the gui is too slow and the button replyes after about 30 seconds after i hit the button

any way to make it faster?

Share this post


Link to post
Share on other sites
BrettF

ok it works but the gui is too slow and the button replyes after about 30 seconds after i hit the button

any way to make it faster?

Maybe?

ToolTip("Downloading", 0, 0, "Info")
While 1
    $nmsg = GUIGetMsg()
    Select
        Case @InetGetActive
            Select
                Case $nmsg = $b_cansel
                    InetGet("abort")
                    ExitLoop
                Case $nmsg = $GUI_EVENT_CLOSE
                    InetGet("abort")
                    Exit
            EndSelect
        Case Else
            ExitLoop
    EndSelect
WEnd
ToolTip("")

Like I said before, a full GUI would help tenfold.

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  

×