Basic samples. Class types.



Imports Classes

Class MyStrings

  Inherits TStringList

  Private fLastPos As Integer = -1

  Public Overrides Function IndexOf(S As String) As Integer
    fLastPos = MyBase.IndexOf(S)
    return fLastPos
  End Function

  Public Property LastPos
    Get
      return fLastPos
    End Get
  End Property
End Class

Dim l As MyStrings = New MyStrings()
Dim P As Integer
Try
  l.Add("abc")
  l.Add("pqr")
  l.Add("xyz")
  println l.LastPos
  P = l.IndexOf("pqr")
  println P
  println l.LastPos
Finally
  l.Free
End Try



Copyright © 2006-2017 Alexander Baranovsky. All rights reserved.