The Relative of push is pop. Pop removes the last item in an Array, and returns the value into a single (scalar) variable. Again, due To VB Limitations, this one works on strings.

65 Views
Public Function spop(ArrayName() As String) as string
' /* Make Sure the Variable Passed Is An array */
If IsArray(ArrayName) = False Then spop = "not array"

' /* Get The Last Value In The Array */
RetVal = ArrayName(UBound(ArrayName()))

' /* Set The Last Element Of The Array To Nothing */
ArrayName(UBound(ArrayName())) = vbNullString

' /* Check If We Are Working With The Only Element In The Array */
If UBound(ArrayName()) = 0 Then
    ' /* If So, Remove The Array */
    Erase ArrayName()
Else
    ' /* Reset the size of the array to 1 less than it was */
    ReDim Preserve ArrayName(UBound(ArrayName()) - 1)
End If

' /* return The Value Of The last element of the array before we removed it */
spop = RetVal

End Function
About the Author

Richter:
Die Monster! You don't belong in this world!

Dracula:
It was not by my hand, that I am once again given flesh. I was called
here by humans, who wish to pay me tribute!

Richter:
TRIBUTE! You steal men's souls and make them your slaves!

Dracula:
Perhaps the same could be said of all religions....

Richter:
Your words are as empty as your soul. Mankind ill needs a savior such as you!

Dracula:
What is a man?
*Throws A Wine-Filled Goblet*
A miserable little pile of secrets! But enough talk!
Have at you!