Dim P As New PropertyBag P.WriteProperty "A", "2", 1 Debug.Print P.ReadProperty("A", -1)résultat : "2"
Dim P As New PropertyBag P.WriteProperty "A", "1", 1 Debug.Print P.ReadProperty("A", -1)résultat "-1"
Dim P As New PropertyBag P.WriteProperty "A", "1", "_" Debug.Print P.ReadProperty("A", -1)résultat : "1"
Public Sub Serialize(PB as propertyBag) PB.writeproperty "Prop1", prop1 PB.writeproperty "Prop2", prop2 ... End sub Public Sub UnSerialize(PB as propertyBag) prop1 = PB.readproperty "Prop1", prop1 prop2 = PB.readproperty "Prop2", prop2 ... End sub Public Sub Cloner(src as cMaClasse) Dim PB as new propertyBag src.serialize PB me.unserialize PB set PB = nothing End sub Public property Equal(src as cMaClasse) as boolean Dim PB as propertyBag Dim Serial1 as string Dim Serial2 as string Set PB = new PropertyBag src.serialize PB Serial1 = Cstr(PB.Contents) Set PB = new PropertyBag Me.Serialize PB serial2 = Cstr(PB.COntents) Equal Cbool(serial1 serial2) End sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question