[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-devel
Subject:    Re: [Gambas-devel] About List interface
From:       Benoît_Minisini <gambas () users ! sourceforge ! net>
Date:       2012-08-31 18:08:56
Message-ID: 5040FDB8.3050204 () users ! sourceforge ! net
[Download RAW message or body]

Le 31/08/2012 13:57, Tobias Boege a =E9crit :
>
> 4. Backwards enumeration
> I'd like to enable the user to For Each backwards. What would that look
> like? I thought of a property named Backwards which sets a bit in the List
> to start the next enumeration as backwards and returns itself. It would
> look like this then:
>
> For Each List.Backwards
> 	Print List.Current ' All items backwards
> Next
>
> What do you think?

As I said before, each enumeration must be indepedent of List.Current.

Moreover, the syntax should be compatible with other container classes =

(Array and Collection):

Dim vElt As Variant

For Each vElt in TheList
   ...
Next

Anyway, if you want you can implement:

For Each vElt in TheList.Backwards
   ...
Next

But then the Backwards property should use GB_RETURN_SELF() and returns =

a virtual class (named ".List.Backwards") having just its own "_next" =

enumerator.

Regards,

-- =

Beno=EEt Minisini

---------------------------------------------------------------------------=
---
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and =

threat landscape has changed and how IT managers can respond. Discussions =

will include endpoint security, mobile security and the latest in malware =

threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-devel mailing list
Gambas-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic