What is both an Object and an Array? object.parameter object(n).parameter

Author Message
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)
0
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
 
#1
    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)
    0
    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.
     
    #2
      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)
      0
       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 
       
       

       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9