WebSetStandardHost Function

Action

Sets the replacement name for the predefined host name standardhost. If not specified, the default setting is taken from the active profile settings (Settings > Active Profile > Internet > Hosts > Standardhost).

Include file

WebAPI.bdh

Syntax

WebSetStandardHost(in sHost : string,
                   in nPort : number optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sHost Replacement name for the predefined host name standardhost.
nPort Port number appended to the replacement name (optional).

Example

dcltrans
  transaction TMain
  var
    hWeb: number;
  begin
    // Use a standard host name and default port number
    WebSetStandardHost("www.myserver.com");
    // Connect to www.myserver.com on port 80
    WebUrl("http://standardhost", 0.0);
    // Use standard host name and override default/custom port numbers
    WebSetStandardHost("www.myserver.com", 8000);
    // Connect to www.myserver.com on port 8000
    WebUrl("http://standardhost", 0.0);
    // Connect to www.myserver.com on port 8000
    WebTcpipConnect(hWeb, "standardhost", 0);
    // Connect to www.myserver.com on port 8000
    // Since "standardhost" is passed to the function,
    // the third parameter is overridden
    WebTcpipConnect(hWeb, "standardhost", 4000);
  end TMain;

Sample scripts

WebMultiClientIpAddresses01.bdf