Skip to content
⌘ NSIS Forum Archive

questions about push & pop

2 posts

Schultz#

questions about push & pop

what exactly are these functions for when dealing with variables? i have read the Docs a few times and still don't understand what they are for.. i saw them used in the Winamp close utiltiy function but still don't understand what there purpose is.. thanks..
justin#
Basically you can use push and pop to save and restore a variable..
So for example, if you need more than the 10 variables ($0-$9),
you can do things like:


StrCpy $0 "Poop!"

Push $0
; do something using $0, trashing it
Pop $0

; at this point, $0 is back to it's "Poop!" state.


... basically Push puts the string on the top of the stack,
and Pop removes it. Anyway, most people probably won't use
it anyway.

-Justin