Archive: Is the script imperative?


Is the script imperative?
Hi,

I've encountered this strange and irritating behavior when using same user variable multiple times.

Please, check out the attached script and explain why doesn't the script behave imperatively, i.e. what comes first is executed first. :igor:


SectionGetText 0 $R0
SectionSetText 0 "$R0 (I)"
SectionGetText 1 $R0


Instead the instructions with SectionSetText seem to be executed after the last SectionGetText instruction.

What's even more irritating is that
MessageBox instructions are executed as they should be. :hang:

Perhaps I am doing something wrong.

ps. using different user vars is out of the question, as I want it to work in macros/functions.

It's not a bug, it's a known issue with section names. They are only processed when shown. When you're setting the section text to $1, you're actually setting it to $1 and not its content. That's why in the second time you're inserting something into $1 it's getting into the section name too.

For now, you'd have to use static messages or create one variable (using the new Var command) for every section.


I understand. I just thought that the vars are resolved online. But I didn't know about the Var command (didn't find it in documentation). I'll give it a try.

Thanks.


The Var command is only available in the latest CVS version. If it's not in your documentation you are not using the latest CVS version. You can update using NSIS Update or the nightly developement snapshot. For more information go to:

http://nsis.sourceforge.net/site/Development.4.0.html


Yup, solved all the problems with Var.

Thanks a lot. :)