Sign in to follow this  
Followers 0
EmptySpace

How to count loops and show to gui?

7 posts in this topic

How I should count while 1 loops?

I know progresson.. but it makes that graphical thing I need only show numbers. How I should do that?

Like progress

ProgressOn("Progress Meter", "Increments every second", "0 percent")
While 1
Sleep(1000)
ProgressSet( 1, 1 & " percent") 
Wend

Didnt changed anything from helpfile.

Share this post


Link to post
Share on other sites



quick poor example:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example1()
Exit
; example 1
Func Example1()
    Local $msg
    GUICreate("My GUI") ; will create a dialog box that when displayed is centered
$hlabel = GUICtrlCreateLabel("0",10,10,100,20)
    GUISetState(@SW_SHOW) ; will display an empty dialog box
For $i = 1 To 100
  GUICtrlSetData($hlabel,$i)
  Sleep(50)
Next
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc   ;==>Example1

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

How to add this for forever loop? Or just simpliest add

For $i = 1 To 9999999 lol

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

$i = 1

While 1 ;creates an infinite loop
  $i += 1
WEnd

Edited by LurchMan

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Share this post


Link to post
Share on other sites

Oh, Thanks. Forgot about that...

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$sMainText = "Increments every second"
ProgressOn("Progress Meter", $sMainText, "0 percent")
$i = 0
While $i <> 100
  Sleep(1000)
  ProgressSet( $i, $i & " percent", $sMainText)
  $i+=1
Wend
; You can finish off the progress bar with the following
ProgressSet($i, "COMPLETE!", $sMainText)
Sleep(2000)
ProgressOff()
; Or just use a msgbox which I choose to use instead of the above
ProgressOff()
msgbox(32 + 262144, "Progress Meter", "Progress Meter Complete!")

Edited by mechaflash213

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

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  
Followers 0