Results 1 to 18 of 18

Thread: [RESOLVED] CopyMemory Shift Array one position

Threaded View

  1. #18

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: [RESOLVED] CopyMemory Shift Array one position

    Thank you very much.It's too complicated beyond my knowledge. I give up until I find a proper way.

    I look at Lavolpe's ImageList . He also used CopyMemory to shift Collection and array. But it works.

    If iIndex < m_ListCount Then
    CopyMemory ByVal VarPtr(m_Lists(iIndex)), ByVal VarPtr(m_Lists(iIndex + 1)), (m_ListCount - iIndex) * 4&
    CopyMemory ByVal VarPtr(m_Lists(m_ListCount)), vbDefault, 4&
    End If
    If kIndex < m_ListCount Then
    CopyMemory ByVal VarPtr(m_Keys(kIndex)), ByVal VarPtr(m_Keys(kIndex + 1)), (m_ListCount - kIndex) * 8&
    FillMemory ByVal VarPtr(m_Keys(m_ListCount)), 8&, 0
    End If
    m_ListCount = m_ListCount - 1 ' decrement count
    ReDim Preserve m_Lists(1 To m_ListCount) ' resize arrays
    ReDim Preserve m_Keys(1 To m_ListCount)
    Last edited by Jonney; Feb 3rd, 2013 at 08:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width