1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Option Explicit
'Partie déclarative
Private lID As Long
Private sNom As String
Private sInformation As String
'Partie procédurale
Public Property Let ID(ByVal pID As Long)
'Set Me.ID = pID 'le set est réservé aux variables de type objet
lID = pID
End Property
Public Property Get ID() As Long
ID = lID
End Property
Public Property Let Nom(ByVal pNom As String)
sNom = pNom
End Property
Public Property Get Nom() As String
Nom = sNom
End Property
Public Property Let Information(ByVal pInformation As String)
'Set sInformation = pInformation
sInformation = pInformation
End Property
Public Property Get Information() As String
Information = sInformation
End Property
Public Sub SetTableStage(ByRef pID As Long, ByRef pNom As String, ByRef pInfornation As String)
lID = pID
sNom = pNom
sInformation = pInformation
End Sub
'Constructeur par défaut
Private Sub Class_Initialize()
' à ce niveau l'objet n'est pas encore construit
'on ne peut pas encore le référencer par me
'par contre, on peut accèder aux variables internes
'Me.ID = Nothing 'nothing est réservé aux objets et une variable de type long n'est pas un
'Me.Nom = Nothing
'Me.Information = Nothing
lID = 0
sNom = ""
sInformation = ""
End Sub
'Destructeur
Private Sub Class_Terminate()
End Sub |