- NSIS Discussion
- NSIS Array script header
Archive: NSIS Array script header
Afrow UK
13th March 2005 21:05 UTC
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
Yathosho
13th March 2005 21:09 UTC
funny, i wanted to ask about arrays today :)
Afrow UK
13th March 2005 21:27 UTC
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
deguix
14th March 2005 05:26 UTC
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.
deguix
14th March 2005 11:55 UTC
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" :(.
Afrow UK
14th March 2005 17:53 UTC
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
deguix
14th March 2005 18:45 UTC
Hmmm... I just said that Math plugin already does that...
Afrow UK
14th March 2005 19:09 UTC
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
Afrow UK
14th March 2005 19:22 UTC
Uploaded new build where I've changed "." to "->"
-Stu
kike_velez
15th March 2005 12:13 UTC
: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
Afrow UK
15th March 2005 13:48 UTC
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
Afrow UK
15th March 2005 20:50 UTC
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
Comm@nder21
16th March 2005 20:40 UTC
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 ... -
Afrow UK
18th March 2005 10:30 UTC
lol thanks. I'll fix it tonight :D
-Stu
Afrow UK
23rd March 2005 20:15 UTC
Added ${myArray-Exists} flow control function which checks if a value exists in myArray.
-Stu