Function Stack Class

RollUp

Roll the top N stack items up towards the stack top. Item previously on the top of the stack ends up at position Top - N + 1. Function returns True upon success and False upon failure.

Signature (Visual Basic / VBA)

Public Function RollUp( _
      ByVal vPosits As Long _
    ) As Boolean

Code Example

    Assuming
       stkTemp.StringView() = "(Top) 4, 3, 2, 1 (Bottom)"
    for example
       stkTemp.RollUp(3) = True
    leaves
       stkTemp.StringView() = "(Top) 3, 2, 4, 1 (Bottom)"

Parameters

Parameter Description
vPosits The number of stack items that are to be rotated upwards. The function does nothing and returns False if there are fewer than vPosits items on the stack.

Notes & Version History

v1.3 BugFix This Function has been fixed to support the RollUp of elements from Stacks containing Object and/or DataObject type Values.