Checks the availability of the specified page. Terminates performing of the task, if the page was unavailable.


procedure CheckAvailability(aPage: string; aExpectedIP: string = '';
  aIncludedText: string = ''; aUserAgent: string = ''); overload;
procedure CheckAvailability(aCheckItem: TCSCheckItem); overload;
procedure CheckAvailability(aCheckItems: TCSCheckItems); overload;


  • aPage
    • type: string
    • functions: verified page
  • aExpectedIP
    • type: string
    • functions: supposed IP host on which the page is situated
  • aIncludedText
    • type: string
    • functions: text contained in the source code of the checked page
  • aUserAgent
    • type: string
    • functions: User-agent, which will be specified when loading the source code of the checked page
  • aCheckItem
    • functions: record containing the information required to verify the page
  • aCheckItems
    • functions: array of records to check multiple pages


  • To test the page goes through the following algorithm:
    1. verified the availability of the host on which the page is situated. If the host is available, then
    2. if IP host coincides with aExpectedIP or aExpectedIP and equals '0 .0.0.0 ', then
    3. if aIncludedText not empty, the source code of the page is loaded using aUserAgent (redirects are not supported!). If aUserAgent empty, then used User-agent, installed for your browser. If the source code of the page contains aIncludedText or aIncludedText - empty string, then
    4. test passes, the script continues to execute
  • If the test fails, the script will stop execution
  • The procedure may be performed only once, and only being the first method that performed by a script. If there were performed other methods before, the software will ignore CheckAvailability.
  • If you check the array pages, will be checked only the first five elements of array


  1. CheckAvailability('');
  2. CheckAvailability('', '');
  3. CheckAvailability('', '', 'habr');
  4. var CheckItem: TCSCheckITem;
    CheckItem.Page := '';
  5. var CheckItems: TCSCheckITems;
    var CheckItem: TCSCheckItem;
    CheckItem.Page := '';
    CheckItem.ExpectedIP := '';