home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / ch_code / ch13 / server1 / prvclass.cls < prev    next >
Encoding:
Visual Basic class definition  |  1997-02-20  |  1.0 KB  |  50 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "PrvClass"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Option Explicit
  11.  
  12. Private PintegerProperty As Integer
  13. Private PstringProperty As String
  14.  
  15.  
  16.  
  17. Public Property Get integerProperty() As Integer
  18.  
  19.     integerProperty = PintegerProperty
  20.     
  21. End Property
  22.  
  23. Public Property Let integerProperty(ByVal NewValue As Integer)
  24. On Error GoTo IntError
  25.  
  26.     If NewValue < 0 Then
  27.         MsgBox "integerProperty can't be negative"
  28.         Exit Property
  29.     End If
  30.     PintegerProperty = NewValue
  31.     Exit Property
  32.  
  33. IntError:
  34.     MsgBox "There was an error in assigning the value " & NewValue & " to the integerProperty property"
  35.     
  36. End Property
  37.  
  38. Public Property Get stringProperty() As String
  39.  
  40.     stringProperty = PstringProperty
  41.     
  42. End Property
  43.  
  44. Public Property Let stringProperty(ByVal NewValue As String)
  45.  
  46.     PstringProperty = NewValue
  47.     
  48. End Property
  49.  
  50.