Gruys
11th March 2010 13:44 UTC
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
Afrow UK
11th March 2010 14:17 UTC
Read Pop in the manual.
Stu
Gruys
13th March 2010 15:11 UTC
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
Gruys
13th March 2010 15:43 UTC
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.
Afrow UK
13th March 2010 17:47 UTC
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