home *** CD-ROM | disk | FTP | other *** search
Visual Basic class definition | 1997-02-20 | 1.0 KB | 48 lines |
- VERSION 1.0 CLASS
- BEGIN
- MultiUse = -1 'True
- END
- Attribute VB_Name = "Class1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Option Explicit
-
- Private private_StringProperty As String
- Private private_IntegerProperty As Integer
-
- Property Let stringProperty(newValue As String)
-
- private_StringProperty = newValue
-
- End Property
-
- Property Get stringProperty() As String
-
- stringProperty = private_StringProperty
-
- End Property
-
- Property Let IntegerProperty(newValue As Integer)
-
- If Not IsNumeric(newValue) Then
- MsgBox "Invalid value!"
- Exit Property
- Else
- On Error GoTo BigInt
- private_IntegerProperty = newValue
- End If
- Exit Property
-
- BigInt:
- MsgBox "The specified value can't fit in an Integer variable"
-
- End Property
-
- Property Get IntegerProperty() As Integer
-
- IntegerProperty = private_IntegerProperty
-
- End Property
-