Jump to content

Function Loop


Recommended Posts

How can I loop this in a function

Func _Startwait()
 GUICtrlSetData($statusoutput, 'Wait.')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait..')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait...')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait....')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait.....')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait.')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait..')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait...')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait....')
 Sleep(500)
 GUICtrlSetData($statusoutput, 'Wait.....')
 Sleep(500)
EndFunc   ;==>_Startwait

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

#include <Array.au3>
#include <GUIConstants.au3>
$Array = _ArrayCreate("",".","..","...","....",".....")
Dim $Array
GuiCreate("hi")
$statusoutput = GUICtrlCreateInput("",100,5,200,25)
$Click = GUICtrlCreateButton("Click",5,5)
GuiSetState()

While 1

     $msg = GUIGetMsg()
     if $msg = $click Then
         _Startwait()
    EndIf
Wend

Func _Startwait()
While 1
    For $i = 1 To 5
 GUICtrlSetData($statusoutput, $Array[$i])
 Sleep(500)
 next
Wend
EndFunc   ;==>_Startwait

It can be simpeler/faster i think :)

Link to comment
Share on other sites

You mean something like?

Func _Startwait()
    For $x = 1 To 2
        $dot = ""
        For $y = 1 To 5
            $dot &= "."
            GUICtrlSetData($statusoutput, 'Wait' & $dot)
            Sleep(500)
        Next
    Next
EndFunc   ;==>_Startwait
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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