Archive: NSIS Array script header


NSIS Array script header
Here's something that I worked on Today... It allows use of Arrays in NSIS! It's also Object oriented (sort of) meaning that the methods are used like so:

${Array} myArray
${myArray.Push} "string"

Current methods I've created are:
Array, Set, Get, Shift, Unshift, Push, Pop, Put, Slice, Delete, Reverse, Copy, Init, Clear

Readme and example included.
http://myweb.tiscali.co.uk/imker/downloads/Array.zip

Tell me what you think!

-Stu


funny, i wanted to ask about arrays today :)


That's wierd :D

I must say though that it isn't very efficient (it's using INI files as data stores).
This'll be a good substitute though until real arrays are built in (if they ever are!)

-Stu


The NSIS stack is an array, but it's the only one "real" array if you use NSIS by itself.

You could also use Math plugin, which has arrays, and string convertion to array (converts every char to an array item). If you search the forum, there is a very powerful StrRep for Math plugin, for example. It uses arrays, so you can replace lots of words at once.


I've tested it now, and it's great. However, maybe I should have more time go check it out completely...

Before, I also wanted an implementation of arrays on NSIS, and I even had some functions already done (implemented with stack), but I changed to the plugin afterwards because it's easier and doesn't give that message "Installer corrupted" :(.


Thanks deguix :)

I've just got a copy of Visual Studio 2003, so maybe I'll try writing an Array plugin.
I'll have a look at the ExDLL, but I've never done C++ before so it'll be quite a fun task!

-Stu


Hmmm... I just said that Math plugin already does that...


Hmm yeh, but I don't think it has any special built in array functions like the ones I would need?

I'm thinking of a plugin specifically for arrays.

-Stu


Uploaded new build where I've changed "." to "->"

-Stu


:cool: The Power of Imagination !!!

Congratulations for you job ¡

There´s a concept that i don´t understand. Can you explain a little this : ${ArraySection} "section" ?

Thanks in advance


Don't worry, I'm going to remove those settings tonight because they aren't really necessary.

For now, you can just ignore them. You don't need to use them at all.

-Stu


New build uploaded. Please note that ${myArray->Clear} has now become ${myArray->Destroy} ${myArray->Clear} is now reserved for another purpose.

Settings have been removed.

-Stu


typo in readme:
line 12: " - 2. Hot to use"
may be it is :D, but i think the following is correct:
line 63: " 2. How to use"

- a freudian laps ... -


lol thanks. I'll fix it tonight :D

-Stu


Added ${myArray-Exists} flow control function which checks if a value exists in myArray.

-Stu