CreateProgressBar()

Summary

Creates a new progress bar that reports the progress of an operation.

Syntax

CreateProgressBar(string activity, boolean cancel_button)

Argument Contents
activity The text displayed with the progress bar before it is updated.
cancel_button Whether the progress window should contain a Cancel button.

Notes

  • If the progress window is enabled but not visible, calling CreateProgressBar() displays the window.

  • CreateProgressBar() can be called without signaling an error:

    • when the progress window is disabled

    • when the progress bar contains the number of nested progress bars allowed in SetProgressWindow()

  • The cancel_button argument is used only when the first progress bar is created in the progress window. Otherwise, it is ignored.

Example

SetProgressWindow("Status", 1) // Allow only a single progress bar
CreateProgressBar("Calculating...", "True")
for i = 1 to 100 do
stat = UpdateProgressBar("Step Number " + String(i), i)
if stat = "True" then do
ShowMessage("You Quit!")
goto quit_loop
end
x = x + i * i // The meat of this loop
end
quit_loop:
DestroyProgressBar()
ResetProgressWindow() // Return to previous maximum number of progress bars

See Also

Function Summary
DestroyProgressBar() Destroys a progress bar, indicating completion of an operation
ResetProgressWindow() Resets the title and the maximum number of progress bars that can be created in the progress window to the number prior to the last call to SetProgressWindow()
SetProgressWindow() Sets the title and the maximum number of progress bars that can be created in the progress window
UpdateProgressBar() Updates a progress bar in the progress window