WebPageStoreContext Function

Action

Stores the context of the last page in the history, so that it will be available to all subsequent WebPageLink and WebPageSubmit calls. The available memory places are limited to 10 stored contexts. Call the WebPageDeleteContext function if the stored context is not needed any more.

The function call WebBrowserReset(WEB_RESET_ALL) deletes all stored contexts!

Include file

WebAPI.bdh

Syntax

WebPageStoreContext( inout hContext: number ): boolean;

Return value

  • true if the context is stored successfully

  • false otherwise

Parameter Description
hContext Variable that receives a handle to the stored context (used for a call to the WebPageDeleteContext function only.

Example

dcltrans
  transaction TInit
  begin
    //WebSetBrowser(WEB_BROWSER_MSIE5);
    WebSetUserBehavior(WEB_USERBEHAVIOR_FIRST_TIME);
    WebSetDocumentCache(true, WEB_CACHE_CHECK_SESSION);
  end TInit;

  transaction TMain
  var
    hContext: number;
  begin
    WebPageUrl("http://mycompany.com/");
    WebPageStoreContext(hContext);
    WebPageLink("Internet Compliancy Tests");
    WebPageLink("Frame Tests");
    WebPageLink("sample", "Main Frame");
    WebPageUrl("http://quote.broker.com/");
    WebPageLink("quotes", "Document Moved");
    // this is a link of the page: "http://mycompany.com/"
    WebPageLink("VCRocket", "VCRocket", 0, NULL, hContext);
    WebPageDeleteContext(hContext);
  end TMain;