Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3679

Empty array of a type can’t be checked with `IsA` not returned in a Variant

$
0
0

I have this code:

Class cClass
End Class
    
Class cClassSub
  Inherits cClass
  Public pText As String
End Class

Function Test() As cClass()
  Var oEssais() As cClassSub
  Var vVariant As Variant
  Var vSuccess As Boolean
  
  vVariant = oEssais
  
  If vVariant IsA cClass Then 
    vSuccess = True // No
  Else
    vSuccess = False // Yes…
  End If
  
  // Return oEssais : Works
  Return vVariant // Fails
End Function

If my array was not empty, it would work as intended, but with an empty array, the IsA and the Return fails. Is this a bug, or should I do a feature request?

Regards, Antoine

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3679

Trending Articles