Parses the response data for sLeftBoundary and sRightBoundary and stores all strings between these boundaries in saResult. If the right delimiter (sRightBoundary) is not specified (set to NULL), every nMaxLen (must be specified) bytes after the occurrences of sLeftBoundary are returned. In contrary the WebParseDataBoundEx function the second left boundary is only searched after the right boundary has been found or, if the right boundary parameter is omitted, nMaxLen bytes after the occurrence of the first left boundary.
When verifying/parsing an HTML page that consists of multiple frames (HTML documents), you can specify which frame document to verify/parse by specifying the nDocNum parameter. By default (1) the top document (for example a frameset) is scanned. This applies to HTML pages that are retrieved through a page-level command like WebPageUrl or WebPageLink.
It is important to know that all parsing and verification functions must be specified before the Web API call for which the response data should be parsed/verified. You can specify multiple parse/verification functions before a Web API call. The order of the parse/verification functions is not relevant (Exception: WebParseDataBound and WebVerifyDataBound using the flag WEB_FLAG_SYNCHRON).
WebAPI.bdh
WebParseDataBoundArray( inout saResult : array of string, in nMaxCount : number, in sLeftBoundary : string, in sRightBoundary : string allownull, out nFound : number optional, in nOptions : number optional, in nSkip : number optional, in nDocNum : number optional, in nMaxLen : number optional);
Parameter | Description |
---|---|
saResult |
Array of string variable that receives all the strings between the specified boundary strings. |
nMaxCount |
Maximum number of strings copied into the provided array. This value must be less than or equal to the size of the array. |
sLeftBoundary |
Left boundary to compare. |
sRightBoundary |
Right boundary. After the sLeftBoundary has been found, all data is copied into the actual string parameter until the right boundary is found (optional). If this parameter is omitted the nMaxLen parameter must be specified. |
nFound |
Variable that receives the number of the found strings (optional). |
nOptions |
Parsing options (optional). If this flag is omitted, none of the listed options are applied, meaning that the string comparison is case-insensitive, white spaces are not ignored, etc.
|
nSkip |
Specifies the number of parse results that should not be stored in the array (optional). The first element of the array will be the parse-result number nSkip+1. |
nDocNum |
Specifies the document to parse (optional). Specify WEB_DOC_ALL if you want to parse all documents. If this parameter is omitted, the first document gets parsed (see also FLAG_INCLUDE_EMBEDDED). |
nMaxLen |
Specifies the maximum number of bytes copied to each string (optional). If the sRightBoundary parameter is omitted, this parameter must be specified and determines the end of every parsing operation. |
transaction TWeb var sa, sa1 : array[10] of string; nFound, nFound1 : number; i : number; begin WebParseDataBoundArray(sa, 10, "<!--", "-->", nFound); WebParseDataBoundArray(sa1, 10, "Begin", null, nFound1, 0, 0, 0, 5); //5 bytes WebPageUrl("http://lab3"); print("found " + string(nFound) + " comments"); print("found " + string(nFound1) + " Begin... statements"); for i:= 1 to nFound do print(sa[i]); end; for i:= 1 to nFound1 do print(sa1[i]); end; end TWeb;