\' Gambas class file
Inherits Iterador
Private conte As String
Private posicion As Integer = 0
Public Sub _new(contenido As String)
conte = contenido
End
Public Function currenItem() As Variant
Return Super.getlista()[posicion]
End
Public Function primero() As Variant
posicion = 0
While isdone()
If InStr(Super.getlista()[posicion], conte) <> 0 Then
\'posicion ya contiene el texto que necesito...
Break
Endif
posicion += 1
Wend
Return currenItem()
End
Public Function siguiente() As Variant
posicion += 1
While isdone()
If InStr(Super.getlista()[posicion], conte) <> 0 Then
\'posicion ya contiene el texto que necesito...
Break
Endif
posicion += 1
Wend
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