Archive: Plugin question


Plugin question
I'm trying to design a plugin for NSIS and was wondering what happens when the plugin tries to pop a value that does not exist. Does an error occur or is the poped value simply null?

Vytautas


If the stack is empty, popstring will return 1 and the buffer you've pointed to will not be changed.


Thanks.

OT: Is there a command which will clear the stack?

Vytautas


This should do it:

while (!popstring(buf));

I was thinking more along the lines of doing it in NSIS so that it would make it easier to test plugins, e.g. clear the stack before a plugin is called to make sure that not leftover info from the stack is used.

Or maybe posibility to move the stack somewhere call the plugin, process the output and then restore the original stack. :cool: Yes, I know thats not posible but it could be a cool feature in the future???

Vytautas


A macro can be written to Pop until there is an error and write the values into a file. Later, another macro can restore those values from the file/files.