Jump to content

controls as loop exists


 Share

Recommended Posts

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
Link to comment
Share on other sites

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....
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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),
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...