Skip to content
PRGfx edited this page Nov 22, 2014 · 1 revision

This library provides a stack for Text variables.

No requirements.

Usage

declare myStack = TStack_Create();

// Add Elements
TStack_Push(myStack, "some value");

// Check if the stack is empty
log(TStack_IsEmpty(myStack)); // False

// Return top element in stack
log(TStack_Peek(myStack)); // "some value"

// Number of elements on the stack
log(TStack_Size(myStack)); // 1

// Overwrite top element (combined pop & push)
log(TStack_Size(myStack, "something other")); // "some value"

// Remove and return top element
log(TStack_Pop(myStack)); // "something other"

// Clear stack (remove all elements, set size to 0)
TStack_Clear(myStack);

Logging

Setting TStack_Logging = True will log error messages when reading (peek, pop, overwrite) from an empty stack.

You can’t perform that action at this time.