stack#

Variables#

const long

Size

const bool

Full

Constructors#

Functions#

void

Free() deprecated

void

Own()

void

Clear()

void

PushBack(untyped val)

void

PushFront(untyped val)

untyped

PopBack()

untyped

PopFront()

untyped

PeekBack()

untyped

PeekFront()

untyped

Get(long ind)

void

Set(long ind, untyped val)

Variable descriptions#

const long Size πŸ”— Source

The size of the stack, given as a LONG. This means that a stack with 5 items will have a size of 5L.


const bool Full πŸ”— Source

Returns true if the stack cannot hold any more elements.


Constructor descriptions#

stack stack() πŸ”— Source


Function descriptions#

void Free() πŸ”— Source

De-allocates this stack pointer, so that its’ pointer ID may be re-used. You may only have a limited number of stack pointers active at a time; freeing them when you are done with them helps not reach the limit.

Warning

Deprecated! Free() no longer does anything as of ZC 3.0. Objects are now freed automatically.


void Own() πŸ”— Source

Grants β€˜Ownership’ of the stack pointer to the script that calls this function. When the script with β€˜Ownership’ terminates (at the same time its’ local arrays are deallocated), this stack pointer will automatically be β€˜Free()’d.


void Clear() πŸ”— Source

Removes every element from the stack.


void PushBack(untyped val) πŸ”— Source

Pushes the given value to the back or front of the stack.

If the stack is at max capacity, does nothing.


void PushFront(untyped val) πŸ”— Source

Pushes the given value to the back or front of the stack.

If the stack is at max capacity, does nothing.


untyped PopBack() πŸ”— Source

Removes the back or front element of the stack, and returns it.

If the stack is empty, 0 is returned.


untyped PopFront() πŸ”— Source

Removes the back or front element of the stack, and returns it.

If the stack is empty, 0 is returned.


untyped PeekBack() πŸ”— Source

Returns the back or front element of the stack, without removing it.

If the stack is empty, 0 is returned.


untyped PeekFront() πŸ”— Source

Returns the back or front element of the stack, without removing it.

If the stack is empty, 0 is returned.


untyped Get(long ind) πŸ”— Source

Returns the element at the index β€˜ind’, which is a LONG value. This means that 0L is the first element, 1L is the second, etc.


void Set(long ind, untyped val) πŸ”— Source

Overwrites the element at the index β€˜ind’ (which is a LONG value) with β€˜val’. This means that 0L is the first element, 1L is the second, etc.