Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Inherits Iterador
- Private posicion As Integer = 0
- Public Function currenItem() As Variant
- Return Super.getlista()[posicion]
- End
- Public Function primero() As Variant
- posicion = 1
- Return currenItem()
- End
- Public Function siguiente() As Variant
- posicion += 2
- If isdone() Then
- Return currenItem()
- ' Else
- ' posicion = 0 'vuelvo a empezar...
- ' Return currenItem()
- Endif
- End
- Public Function isdone() As Boolean
- 'hay siguiente?
- If posicion < Super.getlista().count Then
- 'si, hay siguiente
- Return True
- Else
- 'no, ya se ha acabado la lista...
- Return False
- Endif
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement