Skip to content

Unexpected result on the "Splice" method #21

@yves-amevoin

Description

@yves-amevoin

Describe the bug
It seems if the length of the table is less or equal than 3, the Splice method erases the last value even when asking not to.

To Reproduce
Steps to reproduce the behavior:

Sub TestSplice()
    Dim colData As BetterArray
    
    Set colData = New BetterArray
    colData.LowerBound = 1
    
    colData.Push "1", "2", "3"
    'Items are "1", "2", "3"
    Debug.Print colData.Length
    'Length is 3
    
    colData.Splice 2, 0, ""
    'Items are "1", "", "2"
    'Expected Items are "1", "", "2", "3"
    
    Debug.Print colData.Length
    'Value is 3 instead of 4.

End Sub

Operating System:

  • Windows

Host Application:

  • MS Excel

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions