Old 13th March 2005, 20:05   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 13th March 2005, 20:09   #2
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
funny, i wanted to ask about arrays today
Yathosho is offline   Reply With Quote
Old 13th March 2005, 20:27   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That's wierd

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
Afrow UK is offline   Reply With Quote
Old 14th March 2005, 04:26   #4
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
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.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2005, 10:55   #5
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
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" .

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2005, 16:53   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 14th March 2005, 17:45   #7
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Hmmm... I just said that Math plugin already does that...

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 14th March 2005, 18:09   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 14th March 2005, 18:22   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Uploaded new build where I've changed "." to "->"

-Stu
Afrow UK is offline   Reply With Quote
Old 15th March 2005, 11:13   #10
kike_velez
Member
 
Join Date: Jun 2004
Location: Barcelona
Posts: 57
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
kike_velez is offline   Reply With Quote
Old 15th March 2005, 12:48   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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 is offline   Reply With Quote
Old 15th March 2005, 19:50   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 16th March 2005, 19:40   #13
Comm@nder21
Major Dude
 
Join Date: Jul 2003
Location: germany, b-w
Posts: 734
Send a message via ICQ to Comm@nder21
typo in readme:
line 12: " - 2. Hot to use"
may be it is , but i think the following is correct:
line 63: " 2. How to use"

- a freudian laps ... -
Comm@nder21 is offline   Reply With Quote
Old 18th March 2005, 09:30   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
lol thanks. I'll fix it tonight

-Stu
Afrow UK is offline   Reply With Quote
Old 23rd March 2005, 19:15   #15
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Added ${myArray-Exists} flow control function which checks if a value exists in myArray.

-Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump