09-11-2023, 09:11 AM
Quote:Just curious, where would a stack be handy in QB64 programming?A stack is used where there are an arbitrary number of temporary values that need to be retained for an arbitrary length of time. Or, in English , When you have one or more values that you think will be needed at a later point in the program but you don't know the exact number of values that will need retaining. The other thing to note is that the values are retrieved from a stack in reverse order to how they were added - i.e. the last value added is the first retrieved (Last In, First Out aka LIFO).
In QB64PE, emulated stacks are less useful due to not being able to add an array to to user-defined type. This in effect limits you to a single global (emulated) stack.
TR