> Hi, everybody. I've been thinking for a while that I'd like to come up with > a gambas equivalent for the useful 'registry settings' functions included > in visual basic 6 - obviously they couldn't use the registry in the same > way, since that doesn't really exist in Linux, but the need for a simple > way of saving and reloading the last known state of my programs and other > simple details is something that does carry over. The most important > routines to me, are: > > SaveSetting (appname, section, key, value) - saves the given value, filed > by appname, section, and key > GetSetting (appname, section, key, optional defaultvalue) - returns the > previous value saved for the given appname, section, and key. If no > previous value is found, returns defaultvalue if it is supplied, or else > an empty string. > > GetAllSettings (which returns a two-dimensional array of all keys and > values for a given appname and section) and DeleteSetting (which clears > out the previous value for an appname/section/key) would be useful too, > but not critical. > > So - any suggestions for how best to handle this? I've been wondering about > the storage medium - if I can actually dynamically write .ini type files, > or if it would be easier to handle this in a sqlite database format. Also, > I'm not sure about where to put the files so that they'd be found no > matter what gambas program is accessing them, (is there a way to find out > what the user's home directory path is called?) and if I go with sqlite, > I'd need a way to test to see if my table is already in the sqlite file or > not. > > Sorry for the rambling-ness. Any replies would be appreciated.
Did you notice the "gb.settings" component? -- Benoît Minisini ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user