I just read something:
"A stack is typically implemented with an array. Initialize the array when your application starts. Then, at the beginning of each procedure, place the procedure’s name as the last element of the array, moving all other array elements up by one. Just before the procedure exits, it should remove its name from the array. "
but dont know how to create array, initialize, or move all element arrays up by one, can anyone give me an example please.
i tried the code below, and i am getting a script out of range on sub One
Private callStack() As String
callStack(UBound(callStack) + 1) = "One"
callStack(UBound(callStack) + 1) = "Two"
callStack(UBound(callStack) + 1) = "three"
Dim i As Integer
For i = 0 To UBound(callStack)
You have to redim dynamically sized arrays if you want to add elements to them. It's telling you you're not allowed to to set callStack(1) = "whatever" because it has zero elements. You have to Redim it to have the number of required elements first. At one time I had a bunch of array manipulation routines for push, pop, shift etc. I'll see if I can locate those.