Skip to content

PERCWIN_SET ​

PERCWIN_SET sets a new percentage value and/or a new message text.

Syntax ​

leo-grammar
CC "AdoScript" PERCWIN_SET	[ percentage:realValue ] [ text:strValue ]
							[ percentage2:realValue ] [ text2:strValue ]

 # --> RESULT ecode:intValue .
CC "AdoScript" PERCWIN_SET	[ percentage:realValue ] [ text:strValue ]
							[ percentage2:realValue ] [ text2:strValue ]

 # --> RESULT ecode:intValue .

Parameters ​

  • percentage (realValue, optional) - sets the current percentage value of the progress bar
  • text (strValue, optional) - sets a message text (e.g. about the current action)
  • percentage2 (realValue, optional) - sets the percentage value of the second progress bar
  • text2 (strValue, optional) - sets a message text for the second percentage bar

Returns ​

  • ecode (intValue) - Contains the error code or 0 in case of success.

Details ​

See Also ​

PERCWIN_CREATE
PERCWIN_IS_CANCELED
PERCWIN_DESTROY

Examples ​

asc
SET t1:(getTickCount())
CC "AdoScript" PERCWIN_CREATE title:"Performance-Test"
SET count:20000
FOR i from:1 to:(count) {
    SET text:("This is a test:\n"
            + STR INT (random()*1000) + " "
            + STR INT (random()*1000) + " "
            + STR INT (random()*1000))
    CC "AdoScript" PERCWIN_SET percentage:(100 * i / count) text:(text)
}
CC "AdoScript" PERCWIN_DESTROY
SET t2:(getTickCount())
SET sec:((t2 - t1) * 0.001)
CC "AdoScript" INFOBOX ("The script took " + STR sec + " seconds.")
SET t1:(getTickCount())
CC "AdoScript" PERCWIN_CREATE title:"Performance-Test"
SET count:20000
FOR i from:1 to:(count) {
    SET text:("This is a test:\n"
            + STR INT (random()*1000) + " "
            + STR INT (random()*1000) + " "
            + STR INT (random()*1000))
    CC "AdoScript" PERCWIN_SET percentage:(100 * i / count) text:(text)
}
CC "AdoScript" PERCWIN_DESTROY
SET t2:(getTickCount())
SET sec:((t2 - t1) * 0.001)
CC "AdoScript" INFOBOX ("The script took " + STR sec + " seconds.")

Versions and Changes ​

Available since ADOxx 1.3