Archive: Nullsoft local variables


Nullsoft local variables
Following the Error Handling discussion that was started I would like to ask or possibly start a discussion about the possibility of local variables in NSIS. This may due to my lack of true understanding of the language (I have been using it for 2 years now) but I am finding that when I write macros or functions I am stumbling over my feet while using the Registers variables. The functions become hard to read and error prone due to using registered variables do not reflect the intended use. Using global variables makes information hiding impossible.

Is it possible in the future to have variables with scope local to the function? Does anyone else feel this way?


With that I agree and there is already an open feature request for that. I just have no good idea of how I'd want this implemented yet. It seems like it'd require memory allocation for each function call and a lot more complicated processing of scripts.

BTW, it's NSIS, not Nullsoft. Nullsoft is the company name.


Sorry. My project and program manager both call NSIS nullsoft and I just gave up correcting them so now I say nullsoft so they wont be confused.

I found the request you were talking about. I would put weight on the request being a fairly important one for the evolution of the language. NSIS is already miles ahead of Wise and Installshield in flexibility and stability. This would definitely improve the maintainability of the code people write. Thanks for hearing me out.