Archive: Clear to stack


Clear to stack
Is there a method to clear the stack?

On the stack there is an errorcode 5, I can pop as many as i want but the stack will not be emptied.



# name the installer
outFile "bare.exe"

# default section start; every NSIS script has at least one section.
section
pop $0
MessageBox MB_OK "$0" ; displays 5
pop $0
MessageBox MB_OK "$0" ; still displays 5
pop $0
MessageBox MB_OK "$0" ; still displays 5
pop $0
ClearErrors ; does not help
MessageBox MB_OK "$0" ; still 5
pop $0
MessageBox MB_OK "$0" ; stack is NEVER empied?!


# default section end
sectionEnd


Anyone knows how to clear the stack? :-(

Thanks advance


Read Pop in the manual.

Stu


I have done this.
But, like I earlier said, Pop does reads a string of the stack into the user variable $x, but does not pops the value of the stack, so it leaves the stack alone.

Really weird

Thx in advance


I have solved the mystery. Because the stack was empty the original value in $0 was never overwritten when popping again from an empty stack. Thanks for listening.


As I said, the manual effectively tells you this. If you Pop from the stack when it is empty the error flag will be set (it does not say you will get an empty value).

Stu