The ProgressBar Class

ProgressBar(string message, bool cancel, integer steps)

Initializes a new instance of the class to manage progress bars

Argument Contents
message The message to be displayed on top of the bar
boolean A boolean indicating whether to include a Cancel button or not (default is False)
steps The total number of stages the progress bar will advance through.

Methods

SetNumSteps(integer steps)

Sets the number of steps in the progress bar

SetMessage(string msg)

Sets the message to display in the progress bar

bool cancel_clicked = Step(optional amt [, optional message])

Increments the progress bar by one step or the value specified in amt, and changes the progress bar message if the optional argument is provided. Returns a Boolean with a value of "True" if the Cancel button was clicked, "False" otherwise.

Destroy()

Destroys the progress bar

Example


  macro "p"
    on escape, error do
        MessageBox( GetLastError(), { Caption: "Error", Buttons: "OK", Icon: "Error" })
        return()
    end
    dim arr[300]
    arr2 = {100, 765, 456, 43, 65, 6345, 77}
    pbar = CreateObject("ProgressBar", "Status22", true, arr.length)
    for i in arr do
        pbar2 = CreateObject("ProgressBar", "Status 2nd Progress", true, arr2.length)
        for j in arr2 do
            Sleep(100)
            pbar2.Step()
        end
        pbar2.Destroy()
        if pbar.Step() then
            Throw("User cancelled")
    end
    pbar.Destroy()
endmacro
  

See Also:

Alphabetical List of GISDK Classes

©2026 Caliper Corporation www.caliper.com

 

©2026 Caliper Corporation