What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » HELP - Arrays in the registry!

Pages: (2): « First « 1 [ 2 ] Last »
HELP - Arrays in the registry!
Author: Message:
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
33 / Male / Flag
Joined: Jan 2006
RE: HELP - Arrays in the registry!
May I make the recommendation to use an XML or INI file rather than registry keys for such a large amount of data.  You seem to have layered information which would fit nicely in an XML format imho.

Here is a link to information http://www.devguru.com/technologies/xmldom/quickref/xmldom_index.html . You might also want to look around for some code snippets.  I hope this helps.
[Image: markee.png]
06-20-2009 07:14 AM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: HELP - Arrays in the registry!
quote:
Originally posted by CookieRevised
Provided "Id" and "Title" were saved as a string (and read out as a string), yes...

PS: since this is JScript, you could also do:
JScript code:
var WndLstId = ReadRegistry("Lst", "Id");
WndLstId = WndLstId.split(",");
var WndLstTitle = ReadRegistry("Lst", "Title");
WndLstTitle = WndLstTitle.split(",");
// ...

So you don't realy need the temporary variables, you could just assign a string to your existing WndLstWhatever  variable and then use that same string variable to make it into an array. JScript is fine with that (as it automatically converts and overwrites the types in this case).

This might save you a lot of variable names and code.

Although there are a lot more, and more efficient methods to do what you do though (storing a lot of individual variables in the registry I mean).

Well, I did find an even quicker method, that still uses normal variables:
Javascript code:
WndLstId = ReadRegistry("Lst", "Id").split(",");
WndLstTitle = ReadRegistry("Lst", "Title").split(",");
// ...




quote:
Originally posted by markee
May I make the recommendation to use an XML or INI file rather than registry keys for such a large amount of data.  You seem to have layered information which would fit nicely in an XML format imho.

Here is a link to information http://www.devguru.com/technologies/xmldom/quickref/xmldom_index.html . You might also want to look around for some code snippets.  I hope this helps.
Well, I have had a look, but I'm still confused with the whole idea of XML reading/writing.  :S
06-20-2009 11:55 AM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
29 / Male / Flag
Joined: Jul 2006
RE: HELP - Arrays in the registry!
quote:
Originally posted by whiz
quote:
Originally posted by markee
May I make the recommendation to use an XML or INI file rather than registry keys for such a large amount of data.  You seem to have layered information which would fit nicely in an XML format imho.

Here is a link to information http://www.devguru.com/technologies/xmldom/quickref/xmldom_index.html . You might also want to look around for some code snippets.  I hope this helps.
Well, I have had a look, but I'm still confused with the whole idea of XML reading/writing.  :S
just try some examples, practice with some made up examples and after a day of that you should start to get the hang of it...

also, this is for your interface maker project, why not just save the xml as an interface, then work out how to re-load it into your script, this would give your script more functionality as well because you could load any window into it and then edit that window!
06-20-2009 12:05 PM
Profile PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
O.P. RE: HELP - Arrays in the registry!
quote:
Originally posted by NanaFreak
just try some examples, practice with some made up examples and after a day of that you should start to get the hang of it...

also, this is for your interface maker project, why not just save the xml as an interface, then work out how to re-load it into your script, this would give your script more functionality as well because you could load any window into it and then edit that window!
I have had a bit of a discussion about this:
mynetx's reply to "Interface Writer | [release] 1.2" (and onwards)
06-21-2009 09:49 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On