Return type of Arraygetindex()

hello everyone,

do you have the answer??? I have this array and what i want is if the varient “sam” contains NULL i should go inside if condition and it should print “hi”

I can clerly see in the debugger that Arraygetindex() is returning NULL and the varient sam contains NULL but still the the program is not going inside the if condition.

plz reply soon am stuck in it!!!

Sub Click(Source As Button)

Dim Test(0 To 5)As String

Test(0)="samrat"

Test(1)="24"

Test(2)="abhi"

Test(3)="25"

Test(4)="priya"

Test(5)="26"



Dim sam As Variant

sam= Arraygetindex( Test, "xxx" )



If sam =""  Then

	Msgbox "hi"

Else

	Msgbox "else hi"

End If

End Sub

Subject: return type of Arraygetindex()

Arraygetindex() returns Long.You are comparing as if the return result was String.

Try:

If sam = NULL then

Or

If isNull(sam) then

Regards

Litty Joseph

Subject: return type of Arraygetindex()

got the answer :wink: … if condition seems to be working with

If IsNull(sam) Then

	Msgbox "hi"

Else

	Msgbox "else hi"

End If