BrowserGetStandardHost Function

Action

Gets the replacement name for the predefined host name "standardhost" set by the BrowserSetStandardHost function, or initially defined in the active profile settings (Settings > Active Profile > Internet > Hosts > Standardhost).

Include file

BrowserAPI.bdh

Syntax

BrowserGetStandardHost( sHost   : out string, 
                        nMaxLen : in number optional, 
                        nPort   : out number optional ): boolean;
Parameter Description
sHost String buffer receiving the current name of the standardhost.
nMaxLen Optional: The maximum length of the receive buffer sHost.
nPort Optional: Variable receiving the current port number of the standardhost.

Return value

  • true if successful

  • false otherwise

Example

benchmark SilkPerformerRecorder

use "Kernel.bdh"
use "BrowserAPI.bdh"

dcluser
  user
    VUser
  transactions
    TInit           : begin;
    TMain           : 1;

var

dclrand

dcltrans
  transaction TInit
  begin
  end TInit;

  transaction TMain
  var
    sHost : string;
    nPort : number; 
  begin 
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);
    
    // get the standard host name & port and print them
    BrowserGetStandardHost(sHost, STRING_COMPLETE, nPort); 
    print("Standardhost: '"+sHost+"'");
    print("Port: '"+string(nPort)+"'");
    // set the standard host name to demo.borland.com and port to 80
    BrowserSetStandardHost("demo.borland.com",80);
    // Navigate to demo.borland.com on port 80
    BrowserNavigate("http://standardhost");
    // set the standard host name to www.google.com and port to 80
    BrowserSetStandardHost("www.google.com");
    // Navigate to www.google.com
    BrowserNavigate("http://standardhost");
    
    // revert to previous state
    BrowserSetStandardHost(sHost, nPort);
  end TMain;