I have defined a Class called EntSor (see code ) with a procedure Sub
Définit which assign the values of this class.
Then I have defined an Arraylist with
Dim colEntSor As New ArrayList()
The following code assign the values of the last lign to all elements of the
collection:
EntSor.Définit("PAAE", "bar", 0, True) : colEntSor.Add(EntSor)
EntSor.Définit("TAAE", "°C", 0, True) : colEntSor.Add(EntSor)
EntSor.Définit("QAAE", "kg/s", 0, True) : colEntSor.Add(EntSor)
EntSor.Définit("XVAE", "%", 0, True) : colEntSor.Add(EntSor)
What is wrong ?
Thanks
Bernard
==============================================
Public Class EntSor
Private mNomVal As String
Private mNomUnit As String
Private mDonnées As Boolean
Private mValeur As Decimal
Public Property NomVal() As String
Get
Return mNomVal
End Get
Set(ByVal Value As String)
mNomVal = Value
End Set
End Property
Public Property NomUnit() As String
Get
Return mNomUnit
End Get
Set(ByVal Value As String)
mNomUnit = Value
End Set
End Property
Public Property Données() As Boolean
Get
Return mDonnées
End Get
Set(ByVal Value As Boolean)
mDonnées = Value
End Set
End Property
Public Property Valeur() As Decimal
Get
Return mValeur
End Get
Set(ByVal Value As Decimal)
mValeur = Value
End Set
End Property
Public Sub Définit(ByVal sNomVal As String, _
ByVal sNomunité As String, _
ByVal dVal As Decimal, _
ByVal bDonnées As Boolean)
With Me
..NomVal = sNomVal
..NomUnit = sNomunité
..Valeur = dVal
..Données = bDonnées
End With
End Sub
End Class
--
Bernard Bourée
be*****@bouree.net