ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / HTTP functions
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
HTTPProgressBar (Function)
In french: HTTPJauge
Displays a progress bar when:
  • receiving the response to an HTTP request.
  • sending an HTTP form (HTTPSendForm) or an HTTP query.
Use conditions: The progress of the response progress bar will be possible only if the Web server that processes the HTTP request indicates the length of data to return in its response.
This can be checked by seeing the HTTP header of the response with HTTPGetResult associated with the httpHeader constant.
If the HTTP header contains "Content-Length:" with the length of the response, HTTPProgressBar will be used to follow the progress.
Example
// Display the receive progress bar in PROGBAR_ProgBar
HTTPProgressBar(PROGBAR_ProgBar)
...
// Cancel this progress bar
HTTPProgressBar("")
// The receive progress bar is managed by the ManageProgress procedure
HTTPProgressBar("ReceiveProgress")
PROCEDURE ReceiveProgress(TotalByte, TotalTransmitted)
Message("Transfer in progress: " + TotalTransmitted + " / " + TotalByte)
PROGBAR_ProgBar = TotalTransmitted/TotalByte
// The receive progress bar is managed by the HTTPProgress event
HTTPProgressBar("HTTPProgress")
// -- Initialization code of window
Event(ManageBar, "*.*", "HTTPProgress")
PROCEDURE ManageBar(TotalByte, TotalTransmitted)
Trace("Transfer in progress: " + TotalTransmitted + " / " + TotalByte)
Syntax

Displaying the progress bar in a Progress Bar control Hide the details

HTTPProgressBar(<Receive Progress Bar> [, <Frequency of receive Progress Bar> [, <Send Progress Bar> [, <Frequency of send Progress Bar>]]])
<Receive Progress Bar>: Character string
Name of the Progress Bar control where the receive progress bar will be displayed. This control must exist in the current window.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
<Frequency of receive Progress Bar>: Optional integer
Frequency for refreshing the receive progress bar (in bytes). The default frequency is set to 10.000 (the progress bar is refreshed every 10 KB). Caution: this frequency is given for information only.
<Send Progress Bar>: Optional character string
Name of the Progress Bar control where the progress bar for sending data will be displayed. This control must exist in the current window.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
AndroidAndroid Widget Java This parameter is not available.
<Frequency of send Progress Bar>: Optional integer
Frequency for refreshing the progress bar used to send data (in bytes). The default frequency is set to 10.000 (the progress bar is refreshed every 10 KB). Caution: this frequency is given for information only.
AndroidAndroid Widget Java This parameter is not available.

Managing the progress bar via a procedure Hide the details

HTTPProgressBar(<Name of receive procedure> [, <Frequency of receive Progress Bar> [, <Name of send procedure> [, <Frequency of send Progress Bar>]]])
<Name of receive procedure>: Character string
Name of the WLanguage procedure that will manage the progress bar for receiving data.
This procedure has the following format:
PROCEDURE <Procedure name> (<Total>, <Progress>)
where:
  • <Total> is the number of bytes to receive.
  • <Progress> is the number of bytes already received.
    Remark: If the server does not return the total expected size, <Total> will be equal to <Progress>.
These parameters can be used in the procedure at any time.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
<Frequency of receive Progress Bar>: Optional integer
Frequency for refreshing the receive progress bar (in bytes). The default frequency is set to 10,000 (the procedure is called every 10 KB). Caution: this frequency is given for information only.
<Name of send procedure>: Optional character string
Name of the WLanguage procedure that will manage the progress bar for sending data.
This procedure has the following format:
PROCEDURE <Procedure name> (<Total>, <Progress>)
where:
  • <Total> is the number of bytes to send.
  • <Progress> is the number of bytes already sent.
    Remark: If the server does not return the total expected size, <Total> will be equal to <Progress>.
These parameters can be used in the procedure at any time.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
AndroidAndroid Widget Java This parameter is not available.
<Frequency of send Progress Bar>: Optional integer
Frequency for refreshing the send progress bar (in bytes). The default frequency is set to 10,000 (the procedure is called every 10 KB). Caution: this frequency is given for information only.
AndroidAndroid Widget Java This parameter is not available.

Managing the progress bar via an event Hide the details

HTTPProgressBar(<Name of event for receiving> [, <Frequency of receive Progress Bar> [, <Name of event for sending> [, <Frequency of send Progress Bar>]]])
<Name of event for receiving>: Character string
Name of the event that will be run during the progress of the receive progress bar. This event must be processed by Event. In this case, the wParam parameter (1st parameter of the event) will correspond to the quantity of bytes to transmit and the lParam parameter (second parameter of the event) will correspond to the quantity of bytes already transmitted.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
<Frequency of receive Progress Bar>: Optional integer
Frequency for refreshing the receive progress bar (in bytes). The default frequency is set to 10,000 (the event is triggered every 10 KB). Caution: this frequency is given for information only.
<Name of event for sending>: Optional character string
Name of the event that will be run during the progress of the send progress bar. This event must be processed by Event. In this case, the wParam parameter (1st parameter of the event) will correspond to the quantity of bytes to transmit and the lParam parameter (second parameter of the event) will correspond to the quantity of bytes already transmitted.
If this parameter corresponds to an empty string (""), the current progress bar is canceled.
AndroidAndroid Widget Java This parameter is not available.
<Frequency of send Progress Bar>: Optional integer
Frequency for refreshing the progress bar (in bytes). The default frequency is set to 10,000 (the event is triggered every 10 KB). Caution: this frequency is given for information only.
AndroidAndroid Widget Java This parameter is not available.
Component: wd290com.dll
See also
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help