Funktionreferenz


_IEErrorNotify

Beschreibung anzeigen in

Legt fest, ob die IE.au3 Warnung und Fehler automatisch (auf der Konsole) ausgibt

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

Parameter

$vNotify [optional] Legt fest, ob die Benachrichtigung an oder aus ist
    -1 = (Standard) liefert die aktuelle Einstellung zurück
    True = Einschalten
    False = Ausschalten

Rückgabewert

Ist $vNotify = -1 (Standard), dann wird die aktuelle Einstellung zurückgegeben, sonst 1

Bemerkungen

IE.au3 schreibt standardmäßig Informationen, die bei der Fehlersuche hilfreich sein können, Warnungen und Fehler in die Konsole.
Diese Informationen können einfach angesehen werden, wenn man seine Skripte mit SciTE ausführt.

Diese Funktion erlaubt es, diese Einstellung an- oder auszuschalten.

Beispiel

Beispiel 1

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

; Prüft den aktuellen Status von _IEErrorNotify und schaltet ihn um.

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

Beispiel 2

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

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

ConsoleWrite(@CRLF)
ConsoleWrite('! Schau, was passiert, wenn _IEErrorNotify aktiviert ist' & @CRLF)
Local $oIE = _IECreate('www.google') ; URL ist kaputt
Local $oForm = _IEFormGetObjByName($oIE, "gbqf")
Local $oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! Das kannst du in der Konsole sehen, wenn _IEErrorNotify aktiviert ist' & @CRLF)

ConsoleWrite(@CRLF)
_IEErrorNotify_ON_OFF()
MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Benachrichtigung lautet nun " & _IEErrorNotify())

ConsoleWrite(@CRLF)
ConsoleWrite('! Schau, was passiert, wenn _IEErrorNotify ausgeschaltet ist' & @CRLF)
$oIE = _IECreate('www.google') ; URL ist kaputt
$oForm = _IEFormGetObjByName($oIE, "gbqf")
; $oForm = _IEFormGetObjByName($oIE, "gbqf")
$oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! Das siehst du in der Konsole, wenn _IEErrorNotify ausgeschaltet ist' & @CRLF)
ConsoleWrite(@CRLF)

_IEErrorNotify_ON_OFF()
MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Benachrichtigung lautet nun " & _IEErrorNotify())
ConsoleWrite(@CRLF)

ConsoleWrite(@CRLF)
ConsoleWrite('! Schau, was passiert, wenn _IEErrorNotify mit einigen Errors eingeschaltet ist' & @CRLF)
$oIE = _IECreate('www.google.com') ; URL ist OK
$oForm = _IEFormGetObjByName($oIE, "gbqf", 1) ; Versuch, den Index abzurufen. Index = 1 -> ERROR
$oQuery = _IEFormElementGetObjByName($oForm, "q", 1) ; Versuch, den Index abzurufen. Index = 1 -> ERROR
_IEFormElementSetValue($oQuery, "AutoIt IE.au3")
_IEFormSubmit($oForm)
_IEQuit($oIE)
ConsoleWrite('! Das kannst du in der Konsole sehen, wenn _IEErrorNotify aktiviert ist' & @CRLF)

Func _IEErrorNotify_ON_OFF()
    If _IEErrorNotify() Then
        MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Die Benachrichtigung ist eingeschaltet und wird ausgeschaltet")
        ConsoleWrite('> Schalte _IEErrorNotify aus' & @CRLF)
        _IEErrorNotify(False)
    Else
        MsgBox($MB_SYSTEMMODAL, "_IEErrorNotify Status", "Die Benachrichtigung ist ausgeschaltet und wird eingeschaltet")
        ConsoleWrite('> Schalte _IEErrorNotify an' & @CRLF)
        _IEErrorNotify(True)
    EndIf
EndFunc   ;==>_IEErrorNotify_ON_OFF