Announcement

Collapse
No announcement yet.

Collections?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • José Roca
    replied
    Hmm, only when office is installed..
    If it is not installed, you can do it yourself:

    Windows Script 5.6 for Windows XP and Windows 2000
    http://www.microsoft.com/downloads/d...displaylang=en

    Windows Script 5.7 for Windows XP
    http://www.microsoft.com/downloads/d...displaylang=en

    Leave a comment:


  • Edwin Knoppert
    replied
    Hmm, only when office is installed..

    Leave a comment:


  • Edwin Knoppert
    replied
    Originally posted by José Roca View Post
    You can use the Dictionary object to build collections.
    Is this the dictionary in scrrun.inc ?
    (Microsoft Scripting Runtime)

    ?

    Leave a comment:


  • Edwin Knoppert
    replied
    Thanks,
    At this moment to much work for this little task.
    To busy

    Leave a comment:


  • Dominic Mitchell
    replied
    A collection is not a simple array.
    Since we are talking COM here, what Steven posted is not a collection, but
    the data managed by the collection object can take any form even an array.
    The collection object should implement the following methods:

    Count
    Item
    NewEnum(0xFFFFFFFC)
    Add
    Remove
    Clear

    Relatively easy to do using low-level COM. I think it is doable in PB9, but the
    IDL file will have to be coded by hand.

    Leave a comment:


  • Steven Pringels 3
    replied
    Edwin,

    Ok, I thought you were implementing an 'collection' like functionality in a class.

    Leave a comment:


  • Edwin Knoppert
    replied
    A collection is not a simple array.

    Leave a comment:


  • Steven Pringels 3
    replied
    Code:
    class myclass
    
          instance myCol() 	  as iCollection
          instance m_ColCount as Long
    
          class method Create()
    	  m_ColCount = 0
          end method 
    
          interface iMyclass
          inherit IDispatch
    
    
          method AddData(ByVal ClsCol as iCollection)
    
    	  If IsObject(ClsCol) Then
    
                 Incr m_ColCount
    
    	     Redim Preserve m_Col(m_Colcount) as iCollection
    
                 m_Col(m_ColCount - 1) = ClsCol
    
              End If
    
          end method 
          
          end interface
    
    end class

    Leave a comment:


  • Edwin Knoppert
    replied
    I guess this would result in a different type..
    Some object storage which needs to be casted.

    I'll go for a simple object array or similar..

    IDictionary also gives a lot of .NET examples

    Leave a comment:


  • José Roca
    replied
    You can use the Dictionary object to build collections.

    Leave a comment:


  • Edwin Knoppert
    started a topic Collections?

    Collections?

    Is there an easy example to show me how to prepare a collection?

    I would like to create an 'items' propery.
    Not sure if that is handy anyway, afaik foreach() is not supported at this time(?)

    Or should i use an item method with index?

    I would have a limitted collection so optimized enumeration is not that required at this time.
    Though i find real collections the better thing to use.
Working...
X