[Gambas-user] Request for comments about a language change

Jussi Lahtinen jussi.lahtinen at ...626...
Sun Jun 1 02:25:26 CEST 2014


Oh, of course all enumerable classes, I was thinking command ENUM...
I try to think whether there could be situation where this would hide error
in code.
If for some error you pass Null object to this:

Public Function CountLargeObjects(hArrayOfObjects As Object[]) As Integer

  Dim hObject As Object, iCount As Integer

  For Each hObject In hArrayOfObjects
    If hObject.Size > 100 Then
    Inc iCount
    Endif
  Next

  Return iCount

End


Then it may be harder to catch.
But I don't think that is big deal, if this change has some great
potential..?


Jussi



On Sun, Jun 1, 2014 at 2:28 AM, B Bruen <bbruen at ...2308...> wrote:

> > On Sat, May 31, 2014 at 2:38 PM, Benoît Minisini <
> > gambas at ...1...> wrote:
> >
> > > Hi people,
> > >
> > > Does anybody have an objection against the following change:
> > >
> > > "For Each Value In Enumeration" raise an error if `Enumeration` is
> NULL.
> > >
> > > I suggest that instead it does nothing, as if Enumeration was a void
> array.
> > >
> > > What do you think?
> > >
> > > --
> > > Benoît Minisini
> > >
>
> So, :
> 100  Dim aTest As String[]
> 101  Dim sItem As String
> 102
> 103  For Each sItem In aTest
> 104    Print sItem
> 105  Next
> 106  Print aTest.Count
>
> would just just fail at line 106 rather than 104?
> No objections, I just cant see the point?
>
> regards
> Bruce
> --
> B Bruen <bbruen at ...2308...>
>



More information about the User mailing list