home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / IntroDev / CompTest / CompVB / CompVB.vb < prev    next >
Encoding:
Text File  |  2000-06-23  |  649 b   |  34 lines

  1. Imports System
  2.  
  3. Option Explicit
  4.  
  5. Namespace CompVB
  6.  
  7.     Public Class StringComponent
  8.  
  9.         Private StringSet(4) As String
  10.  
  11.         Public Sub New()
  12.             MyBase.New
  13.             StringSet(0) = "VB String 0"
  14.             StringSet(1) = "VB String 1"
  15.             StringSet(2) = "VB String 2"
  16.             StringSet(3) = "VB String 3"
  17.         End Sub
  18.  
  19.         Public Function GetString(ByVal index as Integer) As String
  20.             If ((index < 0) or (index >= Count)) then
  21.                 throw new IndexOutOfRangeException
  22.             End If
  23.             GetString = StringSet(index)
  24.         End Function
  25.  
  26.         ReadOnly Property Count() As Long
  27.             Get
  28.                 Count = StringSet.Length
  29.             End Get
  30.         End Property
  31.  
  32.     End Class
  33.  
  34. End Namespace