Evaluate with @ValidateInternetAddress [Address822]

Hi,

I try to validate a multiple email store in a field with LS

Each time email contains a dash (-) the eval return nothing (eval does not contains a container).

Here the code:

===========

Sub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument



Dim GroupEmails As Variant

Dim eval As Variant



Set uidoc = workspace.CurrentDocument

Set doc = uidoc.Document



GroupeEmails = doc.GroupEmails



x=0

Forall email In GroupEmails

	eval = Evaluate(|@ValidateInternetAddress([Address821]; | & email & |)|)

’ If Not(eval(0) Is Nothing) Then

	If eval(0) = "" Or eval(0) = " " Then

		eval = Evaluate(|@ValidateInternetAddress([Address822]; | & email & |)|)

	End If

’ Else

	eval = Evaluate(|@ValidateInternetAddress([Address822]; | & email & |)|)

’ End If

’ If Not(eval Is Nothing) Then

	If eval(0) <> "" Then

		Call uidoc.FieldAppendText("Resultat", Cstr(x) & "- " & courriel & " - " & Cstr(eval(0)) & Chr(10))

	End If

’ End If

	x = x + 1

End Forall

End Sub

===========

Why the email with a dash (-) return nothing?

NOTE:

If I add the condition

If Not(eval(0) Is Nothing) Then

It’s return a Type mismatch

any sugg?

Thanks

Subject: Evaluate with @ValidateInternetAddress [Address822]

Just a quick one… I am not sure why the dash would be returning nothing, but I suspect it is generating an error in your evaluate statement.

To bypass the issue (obviously you’ll want to figure out why the issue exists at some stage) for now, you could test to see if eval is an array… if isArray( eval ).

This will make sure that the evaluate statement returns a valid response before continuing with the rest of your logic.

I hope that helps!

T.