so basically i am working on one sub which calls another sub . I don't know why whenever the value of ray is "" (NULL). VB shows runtime error 13-Type mismatch, on this code
"tot = tot + n"
Hope someone can answer my stupid question. Thanksss a lot in advance.

sub main
dim Ray() as double, x as integer
.
.
.
check ray(x)
if found=true then msgbox ("we have found it")

end sub


Sub check(content)
Dim n As Variant, tot As Double
tot = 0

For Each n In Split(content, ",")

tot = tot + n
Next n
If tot = 100 then found = True

End Sub