ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / Progress bar functions
  • Operating mode
  • Equivalences
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 24, GaugeExecute is kept for backward compatibility. This function is replaced by ProgressBarExecute.
Starts a long browser process and fill a Progress Bar via Ajax according to the progress of this process.
In this case, the browser process is divided in a set of small browser processes. The execution of each small process is used to fill the Progress Bar.
Remark: This function can be used in a PHP or AWP site.
Example
// Browser code
ProgressBarExecute(PROGBAR_NoName1, UPD_ProgBar, 0, 100, 10)
// Browser code of the procedure called by the ProgressBarExecute
PROCEDURE UPD_ProgBar(nValue)
// Optional process used to start a server process
AJAXExecute(ServerProcess)
// Browser code
arrValues is array of 6 strings
arrValues[1] = "image1.jpg"
arrValues[2] = "image2.jpg"
arrValues[3] = "image3.jpg"
arrValues[4] = "image4.jpg"
arrValues[5] = "image5.jpg"
arrValues[6] = "image6.jpg"
ProgressBarExecute(PROGBAR_NoName1, UPD_ProgBar, arrValues)
// Browser code of the procedure called by the ProgressBarExecute
PROCEDURE UPD_ProgBar(nValue)
// Optional process used to start a server process
AJAXExecute(ServerProcess)
Syntax

Modifying the Progress Bar via a procedure started on a regular basis Hide the details

ProgressBarExecute(<Progress Bar control> , <WLanguage procedure> , <Lower bound> , <Upper bound> [, <Step>])
<Progress Bar control>: Control name
Name of the Progress Bar control to use
<WLanguage procedure>: Procedure name
WLanguage procedure in browser code called for each iteration. This procedure has the following format:
PROCEDURE <Procedure name>(<Value>)

<Value> corresponds to the current position in the iteration.
<Lower bound>: Real
Minimum value transmitted to the procedure.
<Upper bound>: Real
Maximum value transmitted to the procedure.
<Step>: Optional real
Step for modifying the value between each call to the procedure. This parameter is set to 1 by default.

Modifying the Progress Bar via a procedure started for each array element Hide the details

ProgressBarExecute(<Progress Bar control> , <WLanguage procedure> , <Array>)
<Progress Bar control>: Control name
Name of the Progress Bar control to use
<WLanguage procedure>: Procedure name
WLanguage procedure in browser code called for each array element. This procedure has the following format:
PROCEDURE <Procedure name>(<Value>)

<Value> corresponds to the current array element.
<Array>: Array variable
Name of the Array variable containing the values that must be transmitted to the WLanguage procedure.
Remarks

Operating mode

In browser code, no browser process can be run in background in the context of the page. Indeed, any process locks the refresh of the browser and therefore does not allow the Progress Bar to be refreshed.
ProgressBarExecute calls a browser WLanguage procedure on a regular basis and triggers the refresh of the Progress Bar between each call.
Therefore, a long process must be divided into several steps. These steps are called one by one by the browser WLanguage procedure. If a server process must be performed, it can be started by AJAXExecute used in the code of the browser WLanguage procedure.
ProgressBarExecute is an asynchronous function: it starts the process and it ends immediately. Therefore, when the function returns, the long process may not be ended yet.

Equivalences

ProgressBarExecute is equivalent to the following codes:
First syntax:
FOR Value = <LowerBound> TO <UpperBound> STEP <Step>
<Procedure>(Value)
END
Second syntax:
FOR EACH Value OF <Array>
<Procedure>(Value)
END
Caution: These code are synchronous and therefore does not allow the Progress Bar to be refreshed.
Business / UI classification: UI Code
Component: WDJS.DLL
Minimum version required
  • Version 16
Comments
Click [Add] to post a comment

Last update: 06/07/2022

Send a report | Local help