Jump to content

Progress bar user input


mond1106
 Share

Recommended Posts

Hi,

 

Im new to autoit im exploring some function and I am interested with the progress bar.

 

Is it possible to have a end user input in how much the bar will progress?

 

I saw this code in the examples.

Example()

Func Example()
    ; Display a progress bar window.
    ProgressOn("Progress Meter", "Increments every second", "0%")

    ; Update the progress value of the progress bar window every second.
    For $i = 10 To 100 Step 10
      
        Sleep(1000)
        ProgressSet($i, $i & "%")
    Next

    ; Set the "subtext" and "maintext" of the progress bar window.
    ProgressSet(100, "Done", "Complete")
    Sleep(5000)

    ; Close the progress window.
    ProgressOff()
 EndFunc   ;==>Example
 

Thank you.

Link to comment
Share on other sites

Sure. Something like this?

Example()

Func Example()
    ; Display a progress bar window.
    $sInput = InputBox("Progress", "Set the Step width the progressbar should increment (default is 10%)", 10)
    $iInput = Number($sInput)
    If $iInput = 0 Or $iInput < 1 Or $iInput > 100 Then $iInput = 10
    ProgressOn("Progress Meter", "Increments every second. Step: " & $iInput, "0%")
    ; Update the progress value of the progress bar window every second.
    For $i = 0 To 100 Step $iInput
        Sleep(1000)
        ProgressSet($i, $i & "%")
    Next
    ; Set the "subtext" and "maintext" of the progress bar window.
    ProgressSet(100, "Done", "Complete")
    Sleep(5000)
    ; Close the progress window.
    ProgressOff()
 EndFunc   ;==>Example

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

BTW: When posting code could you please use code tags as described here?

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

25 minutes ago, water said:

Sure. Something like this?

Example()

Func Example()
    ; Display a progress bar window.
    $sInput = InputBox("Progress", "Set the Step width the progressbar should increment (default is 10%)", 10)
    $iInput = Number($sInput)
    If $iInput = 0 Or $iInput < 1 Or $iInput > 100 Then $iInput = 10
    ProgressOn("Progress Meter", "Increments every second. Step: " & $iInput, "0%")
    ; Update the progress value of the progress bar window every second.
    For $i = 0 To 100 Step $iInput
        Sleep(1000)
        ProgressSet($i, $i & "%")
    Next
    ; Set the "subtext" and "maintext" of the progress bar window.
    ProgressSet(100, "Done", "Complete")
    Sleep(5000)
    ; Close the progress window.
    ProgressOff()
 EndFunc   ;==>Example

 

 

 

Thank you I will start working on this.

 

22 minutes ago, water said:

BTW: When posting code could you please use code tags as described here?

 

 

Will do thanks again.

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

×
×
  • Create New...