Skip to content

PERCWIN_IS_CANCELED ​

PERCWIN_IS_CANCELED checks the "canceled" status of the percentage window.

Syntax ​

leo-grammar
CC "AdoScript" PERCWIN_IS_CANCELED

# --> RESULT ecode:intValue canceled:boolValue .

Parameters ​

none

Returns ​

  • ecode (intValue) - ontains the error code or 0 in case of success.
  • canceled (boolValue) - is set 1 if the user has pushed the percentage window's cancel button since it has been created with PERCWIN_CREATE.

Details ​

When PERCWIN_IS_CANCELED returns a nonzero ecode this means that currently no percentage window is existing.

See Also ​

PERCWIN_CREATE
PERCWIN_DESTROY
PERCWIN_SET

Examples ​

asc
CC "AdoScript" PERCWIN_CREATE with-cancel-button
        title:"Push the cancel button"
SET count:10000
FOR i from:1 to:(count) {
    CC "AdoScript" PERCWIN_IS_CANCELED
    IF (canceled) {
        BREAK
    }
    CC "AdoScript" PERCWIN_SET percentage:(100.0 * i / count)
            text:(STR i + "/" + STR count)
    CC "AdoScript" SLEEP ms:5
}
CC "AdoScript" PERCWIN_DESTROY

Creates a percentage window and lets it open for some time. During this time you can use the cancel button, to destroy the percentage window.

Versions and Changes ​

Available since ADOxx 1.3