CoCimSafeArray5 (object)

Allows interaction with OLE automation Safe Array objects.
Description: This object allows you to interact with OLE automation Safe Array objects.

CoCimSafeArray5 is a superset of CoCimSafeArray and can be used anywhere an CoCimSafeArray object is called for.

Example:

Option Explicit
 
Sub OnSmartObject()
 
  Dim msgstr As String
 
  Dim csa As CoCimSafeArray5
  Set csa = CreateObject("CIMPLICITY.CimSafeArray.5")
 
  Dim lbarr(2) As Long
  Dim ecarr(2) As Long
  Dim inarr(2) As Long
  Dim i As Integer
  Dim j As Integer
  Dim k As Integer
  For i = 0 To 2
    lbarr(i) = 0
    ecarr(i) = 2 + i
  Next i
  csa.CreateArray cimVLong, 3, lbarr, ecarr
 
  Dim lb1 As Long
  Dim ub1 As Long
  Dim lb2 As Long
  Dim ub2 As Long
  Dim lb3 As Long
  Dim ub3 As Long
  csa.GetArrayBounds 1, lb1, ub1
  csa.GetArrayBounds 2, lb2, ub2
  csa.GetArrayBounds 3, lb3, ub3
  msgstr = "Setting..."
  For i = lb1 To ub1
    inarr(0) = i
    For j = lb2 To ub2
      inarr(1) = j
      For k = lb3 To ub3
        inarr(2) = k
        msgstr = msgstr & Chr(13) & i & "," & j & "," & k & " ==> " & i*100 + j*10 + k
        csa.SetArrayElement inarr, i*100 + j*10 + k
      Next k
    Next j
  Next i
  MsgBox msgstr
 
  inarr(0) = 1
  inarr(1) = 2
  inarr(2) = 0
  MsgBox csa.GetArrayElement(inarr)
 
  MsgBox "Element3: " & csa.Element3(1, 2, 0)
 
  Set csa = Nothing
 
End Sub
Properties: Dimensions , Type , Value
Methods: CallObjectMethod , CreateArray , CreateVector , Element , Element2 , Element3 , Element4 , Element5 , GetArrayBounds , GetArrayElement , GetObjectProperty , GetObjectPropertyEx , GetVectorBounds , GetVectorElement , SetArrayElement , SetObjectProperty , SetObjectPropertyEx , SetVectorElement