Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15136

How to implement dynamic objects like RC6.DynObj?

$
0
0
RC6 provides a very magical object DynObj, which can dynamically add properties and methods like JavaScript objects, for example:

Code:

Private Sub Form_Load()
  Dim oDyn As Object
  Set oDyn = New_c.DynObj
      oDyn.a = 123
      oDyn.b = "xyz"
      oDyn.c = True
 
  'Ok, readout-tests:
  Debug.Print oDyn.a, oDyn.b, oDyn.c
 
End Sub

If I could use VB6 to achieve a feature/class similar to RC6.DynObj too, it'll greatly promote my work. I'd like to know if anyone other than Olaf has implemented a similar feature? If anyone could provide some suggestions and help, it would be greatly appreciated.

Viewing all articles
Browse latest Browse all 15136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>