ccarrster
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 11/2/2009
-
Status: offline
|
What is both an Object and an Array? object.parameter object(n).parameter
Monday, November 02, 2009 6:19 AM
( permalink)
I am trying to replace a com object with a facade. I am using ADODB recordset to emulate a MSCS recordset which is a Dictionary wrapped in a SimpleList I am using the execute function to build a class at run time and then instantiate that class. It works fine with one row, and it will work fine with an array but the existing code expects both: "object.parameter" and "object(n).parameter" to work the same. any suggestions? Thank you, Chris
|
|
|
|
ccarrster
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 11/2/2009
-
Status: offline
|
Re:What is both an Object and an Array? object.parameter object(n).parameter
Monday, November 02, 2009 12:07 PM
( permalink)
I added an array to my run-time created object and reference the rows like: object.row(n).parameter This is less than ideal but better than nothing.
|
|
|
|
mcnd
-
Total Posts
:
50
- Scores: 2
-
Reward points
:
0
- Joined: 4/27/2008
-
Status: offline
|
Re:What is both an Object and an Array? object.parameter object(n).parameter
Wednesday, November 18, 2009 11:59 PM
( permalink)
Dim obj
Set obj = New CObj
WScript.Echo obj.parameter
WScript.Echo obj(4).parameter
Class CObj
Dim something
Private Sub Class_Initialize
something = "this is something"
End Sub
Public Property Get parameter()
parameter = something
End Property
Public Default Property Get item( x )
Set item = Me
End Property
End Class
|
|
|
|