UDF > IE >


_IEErrorNotify

Indique si IE.au3 doit notifier automatiquement les Avertissements et les Erreurs (dans la console)

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

Paramètre

$vNotify [optionnel] Spécifie si les notifications sont activées ou désactivées
    -1 = (Par défaut) retourne le réglage actuel
    True = Active
    False = Désactive

Valeur de retour

Retourne le réglage actuel de la notification si $vNotify = -1 (par défaut), sinon retourne 1.

Remarques

IE.au3 écrit des informations de diagnostic, des avertissements et des erreurs dans la console par défaut.
Cette information peut facilement être vu lors de l'utilisation de l'éditeur SciTE lors de l'exécution de vos scripts.

Cette fonction vous permet d'activer cette fonctionnalité ou de la désactiver.

Exemples

Exemple 1

; Vérifie l'état actuel de _IEErrorNotify, le désactive si il est actif, l'active s'il est désactivé

#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


Exemple 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 est brisé
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') ; L'URL est incomplète
$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') ; L'URL est OK
$oForm = _IEFormGetObjByName($oIE, "gbqf", 1) ; Essaye de récupérer l'index = 1 -> ERREUR
$oQuery = _IEFormElementGetObjByName($oForm, "q", 1) ; Essaye de récupérer l'index = 1 -> ERREUR
_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