The code is for a test framework. I am currently on the wrong machine to
send the code. But it's something like this:

Dim result As Variant
Dim expected As Variant
Dim i As Integer
Dim isEqual As Boolean

result = myFunction() As Variant


if Typeof(result) = Typeof(expected) Then
   isEqual = True

   'test values
   if expected Is Array Then
      'test each array element against the expected result
      if result Is Array Then
         For i=0 To result.Max()
            if expected[i] <> result[i] then
              isEqual = False
            endif
         Next
      endif
   else
    .....
   endif
endif





On Fri, Mar 16, 2012 at 4:08 AM, Emil Lenngren <emil.lenng...@gmail.com>wrote:

> How does your code look like?
> A boolean is certainly not an array... :)
>
> /Emil
>
> 2012/3/16 Randall Morgan <rmorga...@gmail.com>
>
> > That works as long as a is an array. But it a is an a boolean then I get
> an
> > error "Object expected but got boolean" or float, ect...
> >
> > I too thought it should work that way. Mybe there is a bug in the Gambas
> or
> > my code?
> >
> >
> >
> > On Fri, Mar 16, 2012 at 3:34 AM, Emil Lenngren <emil.lenng...@gmail.com
> > >wrote:
> >
> > > Dim a As New String[]
> > > Print a Is Array
> > >
> > > should work I think...
> > >
> > > 2012/3/16 Randall Morgan <rmorga...@gmail.com>
> > >
> > > > 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
> > > >
> > > > --
> > > > 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?
> > > >
> > > >
> > >
> >
> ------------------------------------------------------------------------------
> > > > 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@lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > > >
> > >
> > >
> >
> ------------------------------------------------------------------------------
> > > 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@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?
> >
> >
> ------------------------------------------------------------------------------
> > 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@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> ------------------------------------------------------------------------------
> 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@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?
------------------------------------------------------------------------------
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to