Stack Class (Collection)

The Stack class allows you to create a collection of data elements accessed on a last-in, first-out (LIFO) basis.

An element is added to the top of the stack collection using push(oElement). where oElement is the data to be added.

myStackObj.push(oElement);              //adds oElement at the top of the stack

Elements are read from the top of the stack using peek().

Plot1(myStackObj.peek().tostring());    //displays element at top of stack as a string

Elements are removed from the stack using pop().

myStackObj.pop();                       //removes element at top of stack

Namespace: elsystem.collections

Properties

   Additional properties, methods, and events are described in the classes listed under Inheritance Hierarchy (see below).

  Name Type Description
Public property Count int Gets the number of elements contained in the stack.
Methods
  Name Description
Public property Clear Removes all object from the stack.
Public property Create Initializes a new instance of the Stack class.
Public property Peek Returns the object at the top of the stack without removing it.
Public property Pop Removes and returns the object at the top of the stack.
Public property Push(obj) Insert an object at the top of the stack.
Inheritance Hierarchy

elsystem.Object

elsystem.Collections.Stack