GetHost(), IsHosted()

Use these functions to manipulate the browser supporting your Active Document.

Usage

lIsOrIsnt = IsHosted()
oBrowser = GetHost()

Parameter

Value

Meaning

lIsOrIsnt

.T.

Current form is hosted within a browser.

.F.

Form is not hosted in a browser.

oBrowser

Null

No browser object is available.

Object

An object reference to the browser is acting as host.


Use the IsHosted() function to separate the logic that should run when your forms are running as ActiveDocuments from the logic that they should use as stand-alone forms. If running as ActiveDocuments, a call to GetHost returns an object reference to the hosting browser. Using this reference, you can determine the identity of the host, and then manipulate the object model of the host (such as turning off features or changing the navigation model) to properly host your application.

Example

IF IsHosted()
  loBrowser = GetHost()
  WAIT WINDOW "Hosted by " + loBrowser.Name
ELSE
  WAIT WINDOW "Not browsing"
  loBrowser = .NULL.
ENDIF

See Also

ActiveDoc


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .