[Gambas-user] how to determine if array its empty

Cristiano Guadagnino criguada at ...626...
Sat Jul 1 19:46:31 CEST 2017


Thank you Jussi, that's a nice trick I didn't know of!
Actually, I didn't even notice there was an extra "if" in Gianluigi's
example.

Cris

On Sat, Jul 1, 2017 at 3:28 PM, Jussi Lahtinen <jussi.lahtinen at ...626...>
wrote:

> If you add the extra "if", then Gambas will do short-circuit evaluation.
> https://en.wikipedia.org/wiki/Short-circuit_evaluation
>
>
> Jussi
>
>
>
> On Sat, Jul 1, 2017 at 3:08 PM, Cristiano Guadagnino <criguada at ...626...>
> wrote:
>
> > Hi Gianluigi!
> >
> > On Sat, Jul 1, 2017 at 12:13 PM, Gianluigi <bagonergi at ...626...> wrote:
> >
> > > or
> > > If IsNull(myArray) Or If myArray.Count = 0 Then Print "Empty"
> > >
> >
> > I have not tried, but I don't think this will work. In an "or" expression
> > you have to evaluate both members, so if myArray is null the
> "myArray.Count
> > = 0" part will generate an out of bounds error.
> >
> > Cris
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list