[Gambas-user] How to test if result is an array

Randall Morgan rmorgan62 at ...626...
Fri Mar 16 18:35:16 CET 2012


I am aware of the warnings. But needed to check in my code so I would have
access to it from another location. You had told me before it was ok to
check in code that contained errors or was incomplete. I then got
distracted and also was hoping to hear back from on some of my questions.
But never did. Now I've lost track of them.

I have done a little more coding and will checking in updated code soon.



2012/3/16 Benoît Minisini <gambas at ...1...>

> Le 16/03/2012 04:14, Randall Morgan a écrit :
> > Hi,
> >
> > I am writing a small test suit and need to tell is the result I got back
> > from a function is an array of some type.
> > Does anyone have a solution for this?
> >
> > Thanks
> >
>
> You can do like that:
>
>        Dim Result As Variant
>
>        Result = TestFunction()
>        If IsObject(Result) And If Result Is Array Then ...
>
> Or that way:
>
>        Dim Result As Variant
>        Dim AnArray As Array
>
>        Result = TestFunction()
>        Try AnArray = Result
>        If Not Error Then ...
>
> Anyway, I compiled the last gb.gsl, and I got many very suspicious
> warnings. Did you aware of them? Or maybe you know what you are doing,
> but don't know how to write your code not to get these warnings?
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
If you ask me if it can be done. The answer is YES, it can always be done.
The correct questions however are... What will it cost, and how long will
it take?



More information about the User mailing list