<-- Previous || Up || Next -->

Nth From Top Property
Stack Class

Public Property Get NthFromTop( _
    ByVal vElement As Long _
    ) As Variant

Return the value of the Nth item from the top of the stack,
The item at the top of the stack is numbered 1 (one).

Example:
    Assuming
       stkTemp.StringView() = "(Top) 4444, 333, 22, 1 (Bottom)"
    for example
       Dim varTemp As Variant
       varTemp = stkTemp.NthFromTop(2)
    leaves
       varTemp = 333
See also:
    Item Property
    Peek Function
vElement: Number of the item whose value should be returned. vElement must be between 1 and Count otherwise this Property returns an Empty value (a Variant whose VarType is vbEmpty).
Return value: Return value is the value of the stack item. It can be any type of Variant value (vbString, numeric, vbDate, vbObject, vbArray, etc.).
v1.3 BugFix: This Property Get Function has been fixed to support the retrieval of Object and DataObject type Values.

Public Property Let NthFromTop( _
      ByVal vElement As Long _
    , ByVal vValue As Variant _
    )

Set the value of the Nth item from the top of the stack,

Note: The item at the top of the stack is numbered 1 (one).
Example:
    Assuming
       stkTemp.StringView() = "(Top) 44, 33, 22, 11 (Bottom)"
    for example
       stkTemp.Item(2) = 555
    leaves
       stkTemp.StringView() = "(Top) 44, 555, 22, 11 (Bottom)"
vElement: Number of the item whose value should be set to vValue. vElement must be between 1 and Count otherwise this procedure silently does nothing.
vValue: The value to which the specified item should be set. vValue can be any type of Variant value (vbString, numeric, vbDate, vbArray, etc.) except an Object or DataObject.
v1.3 BugFix: The corresponding Property Set Subroutine supports the storage of Object and DataObject type Values.

Public Property Set NthFromTop( _
      ByVal vElement As Long _
    , ByVal vValue As Variant _
    )

Set the value of the Nth item from the top of the stack,

Note: The item at the top of the stack is numbered 1 (one).
Example:
    Assuming
       stkTemp.StringView() = "(Top) 44, 33, 22, 11 (Bottom)"
       Dim objTemp As Object
       Set objTemp = Nothing
    for example
       Set stkTemp.Item(2) = objTemp
vElement: Number of the item whose value should be set to vValue. vElement must be between 1 and Count otherwise this procedure silently does nothing.
vValue: The Object or DataObject value to which the specified item should be set.
v1.3 BugFix: This new Property Set Subroutine has been added to support the storage of Object and DataObject type Values.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.