What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » best way to store/save information?

best way to store/save information?
Author: Message:
JonnyT
Junior Member
**


Posts: 28
Joined: Jun 2006
O.P. best way to store/save information?
What would be the best method, and how dyou do it, to store/save information for scripts. Things like settings/options, nicknames etc

Thanks J
06-26-2006 06:00 PM
Profile E-Mail PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: best way to store/save information?
Good question! I would also be interested.
06-26-2006 08:26 PM
Profile E-Mail PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: best way to store/save information?
The registry, definatly. Take a look at the documentation for an example howto do it;)
06-26-2006 08:38 PM
Profile E-Mail PM Find Quote Report
segosa
Community's Choice
*****


Posts: 1407
Reputation: 92
Joined: Feb 2003
RE: best way to store/save information?
Look at the documentation for MsgPlus.ScriptRegPath.
The previous sentence is false. The following sentence is true.
06-26-2006 08:39 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: best way to store/save information?
quote:
Originally posted by JonnyT
What would be the best method, and how dyou do it, to store/save information for scripts. Things like settings/options, nicknames etc

Thanks J
There would be no 'best' method. It highly depends on what those settings actually are.

There are some methods you can use:
1) Saving data in not structured files
2) Saving data in INI files
3) Saving data in XML files
4) Saving data in the registry

For each there are benefits and drawbacks, and each can/should be used for specific scenarios. Which method you choose depends on many things, but in the first place the kind of data to be stored. eg:

1) Saving binary data or data which contains huge lumps of text, etc. Easly portable and easy to backup. Not easy to code, unless 1 file contains only 1 dataset.
2) Saving small settings which don't need complex structures. Easly portable and easy to backup. Can be reconized easly, read in an instant and edited by everyone. Difficult to work with in scripts as it doesn't support an INI structure by default.
3) Saving more complex data structures. Easly portable and easy to backup. Not so easy to see the actual settings at first glance as it contains lots of "special codes". Needs some amount of support code in your script.
4) Saving small settings or not so complex data structures. No files needed and thus not easly porteable. Not everybody knows how to manually edit it, etc. Though requires the least amuont of code in scripts.

Mostly you'll see that the registry is being used as that is the most ideal in many scripts.

This post was edited on 07-02-2006 at 01:53 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-02-2006 01:49 AM
Profile PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: best way to store/save information?
Okay, couple of thngs,

How would you save a setting from a window to the registry. Say you have an EditControl and the defualt text was "hello" and then you changed it to "hello world". How would you save the new data to the registry? I know the procedure to use from the help file, but not in the correct way I need.

Also, how would I do the same for opening a window if I wanted to load my settings. Say the EditControl ID is "ECLocation", how would I read this from the registry, so when I fire my open window procedure it plonks the loaded data into the window ready?

My current open window procedure is...
code:
function OnEvent_MenuClicked(mnuPref)
{
    var Wnd = MsgPlus.CreateWnd("Preferences.xml", "WndPref");
}

Phew - thanks in advance! :)
07-15-2006 03:43 PM
Profile E-Mail PM Web Find Quote Report
Volv
Skinning Contest Winner
*****

Avatar

Posts: 1233
Reputation: 31
35 / Male / Flag
Joined: Oct 2004
RE: best way to store/save information?
PlusWnd.GetControlText to get the text from the EditControl & PlusWnd.SetControlText to set the text of the EditControl.
07-15-2006 03:53 PM
Profile PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: best way to store/save information?
Thanks - will give those a go :)
07-15-2006 04:03 PM
Profile E-Mail PM Web Find Quote Report
« 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