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