Function Reference


_IEErrorNotify

Specifies whether IE.au3 automatically notifies of Warnings and Errors (to the console)

#include <IE.au3>
_IEErrorNotify ( [$vNotify = Default] )

Parameters

$vNotify [optional] specifies whether notification should be on or off
    -1 = (Default) return current setting
    True = Turn On
    False = Turn Off

Return Value

Returns the current notification setting, if $vNotify = -1 (Default), else returns 1.

Remarks

IE.au3 writes diagnostic information, warnings and errors to the console by default.
This information can readily be seen when using the SciTE editor to run your scripts.

This function allows you to turn this functionality on or off.

Example

Example 1

; Check the current status of _IEErrorNotify, turn it off if on, on if off

#include <IE.au3>
#include <MsgBoxConstants.au3>

If _IEErrorNotify() Then
    MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification is ON, turning it OFF")
    _IEErrorNotify(False)
Else
    MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification is OFF, turning it ON")
    _IEErrorNotify(True)
EndIf

Example 2

#include <IE.au3>
#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification now is " & _IEErrorNotify())

ConsoleWrite(@CRLF)
ConsoleWrite('! Look what happens when _IEErrorNotify is ON' & @CRLF)
Local $oIE = _IECreate('www.google') ; URL is broken
Local $oForm = _IEFormGetObjByName($oIE, "gbqf")
Local $oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! This is what you can see in console when _IEErrorNotify is Turned ON' & @CRLF)

ConsoleWrite(@CRLF)
_IEErrorNotify_ON_OFF()
MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification now is " & _IEErrorNotify())

ConsoleWrite(@CRLF)
ConsoleWrite('! Now look what happens when _IEErrorNotify is OFF' & @CRLF)
$oIE = _IECreate('www.google') ; URL is broken
$oForm = _IEFormGetObjByName($oIE, "gbqf")
; $oForm = _IEFormGetObjByName($oIE, "gbqf")
$oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! This is what you can see in console when _IEErrorNotify is Turned OFF' & @CRLF)
ConsoleWrite(@CRLF)

_IEErrorNotify_ON_OFF()
MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification now is " & _IEErrorNotify())
ConsoleWrite(@CRLF)

ConsoleWrite(@CRLF)
ConsoleWrite('! Look what happens when _IEErrorNotify is ON with some ERRORs' & @CRLF)
$oIE = _IECreate('www.google.com') ; URL is OK
$oForm = _IEFormGetObjByName($oIE, "gbqf", 1) ; try to retrieve the index = 1 -> ERROR
$oQuery = _IEFormElementGetObjByName($oForm, "q", 1) ; try to retrieve the index = 1 -> ERROR
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! This is what you can see in console when _IEErrorNotify is Turned ON' & @CRLF)

Func _IEErrorNotify_ON_OFF()
    If _IEErrorNotify() Then
        MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification is ON, turning it OFF")
        ConsoleWrite('> Turning _IEErrorNotify OFF' & @CRLF)
        _IEErrorNotify(False)
    Else
        MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Notification is OFF, turning it ON")
        ConsoleWrite('> Turning _IEErrorNotify ON' & @CRLF)
        _IEErrorNotify(True)
    EndIf
EndFunc   ;==>_IEErrorNotify_ON_OFF