Bryce me old china,

The "pop" UDF won't work, and in fact it can't work in KiXtart because we don't have "pass by reference" [Frown]

Although you are popping off the top of the stack, you are not returning the popped off element - it is lost. "Pop" should pop the element off the top of the stack and return it.
The only way to implement it in a UDF is to use the kludgy work-around of making the array a global variable, and then passing the name and using Execute() to manipulate it.

As an aside, if you are using just "pop" and "push" to manipulate the stack it doesn't matter which end is the "top". This means that you can save the overhead of copying, and just add/remove the end element of the array.