![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello,
i've got a question regarding how i can save my app's settings/preferences. I want so save my app/user settings to somewhere ( file, registry), so i can read them after program start to save the user from doing the settings all the time over and over. 1. Do you need to save settings in your programs.. ? 2. How do you do this..? 2. has anyone a piece of code - or possibly a lib - ready that is handling the settings ( create/read/save)..? i personally tend not to use the registry, for certain reasons, but if one has already something similar in place, i could be persuaded :-)) cheers TWELVE |
|
||||
|
Hello TWELVE,
I save the values of the setting variables in a simple text file when leaving the program. And load this file at startup and set the settings. I do this in all my programs. You can have a look in the Wine Cellar Manager program. Wine cellar manager The routines are SaveInit and LoadInit where I save the Language index, last file used and the table column widths. But anyway there is really nothing special in there. You can also have a look in alfcen's B4ppctemplate. Basic4ppc Program Template Best regards
__________________
Klaus Switzerland |
|
||||
|
Hello Twelve,
maXin has provided a "db2000 - INI" dll in the italian forum (db2000 - INI). A short english translation can be found here in post 6 (Reading config file). For my own programs I often use just an internal (invisible) table to store the settings/preferences because with this you don't have to code some extra lines for the file handling. ![]() specci48 |
|
|||
|
Quote:
COMPort = COM8 Server = "a server" This is not that hard to program, but it is harder than it appears to be..:-) Is some advanced string processing because you don't know where the equals are and the parameter name also could contain some spaces. Quote:
Quote:
cheers TWELVE |
|
||||
|
Quote:
Here's an aboandoned project of mine, but in wich, a full basical ini file reading/wtng is implemented...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
Quote:
Quote:
Since cableguy recommended to use the table.control for prefs file manipulation, this little table thingy appears to be very useful. The table.control solution is easy and done very quickly, but the resulting cfg file is not the style i was thinking of. I wrote now a routine, which removes all spaces at the start and end of each line and returns config key and it's value.That's working with an existing file from the windows version of my application, and this was what i was looking for primarily. Unfortunately now i've got some issues in saving the prefs file.I believed i could just replace a single line within the existing file, but that doesn't work that easy.I opened up a new thread for that, but answers to this were also welcomed here. cheers TWELVE Last edited by TWELVE : 05-11-2008 at 07:15 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GetFile to save to other DIR | tcgoh | Questions & Help Needed | 9 | 08-09-2008 06:17 AM |
| Settings for User's selected 'theme' | willisgt | Questions & Help Needed | 2 | 02-21-2008 05:06 PM |
| Port & Baud GPS settings for TytnII | colin9876 | Questions & Help Needed | 9 | 11-17-2007 11:54 AM |
| Retreive file associations from Registry | mwaite | Code Samples & Tips | 0 | 06-13-2007 01:28 AM |
| Regional Settings: Error loading program. Exception | mtse | Bug Reports | 0 | 05-24-2007 02:40 AM |