Valhalla Legends Forums Archive | Visual Basic Programming | Most efficient way of saving settings on a bot?

AuthorMessageTime
Tontow
  What would be the most efficient way of saving the settings for a bot?  A file? The windows registry? Some other means of storage? Best method of writing it? 

  I think the most effective way of gathering the information that needs to be saved is a textbox control array; if you want to add more options, then just add the needed textbox and add/modify code to handle/read the extra data. - Dose anyone have a better way?
June 5, 2005, 12:50 AM
Quarantine
There was a topic on Ini vs Registry, search. I personally use the registry.
June 5, 2005, 1:24 AM
Tontow
Do you mean https://davnit.net/bnet/vL/phpbbs/index.php?topic=9603.0 ?
Because it seems to be comparing Windows to Linux as pertaining to portability...
June 5, 2005, 2:20 AM
Quarantine
Didn't take time to read, just remembered thread.

The way I do is

have a class:

each class contains properties for everything in my configuration

[code]
Public Property Get Username() as String
        Username = ReadRegistryFunctionLalala(Blah)
End Property

Public Property Let Username(ByVal strUsername as String)
        WriteRegistryFunction(strUsername)
End Property
[/code]
June 5, 2005, 2:55 AM
OnlyMeat
It all depends on what data you are storing, if it's simple data, then go for the registry, if it's more complex, use an application data file.
June 5, 2005, 3:28 AM
Tontow
[quote author=OnlyMeat link=topic=11769.msg114904#msg114904 date=1117942102]
It all depends on what data you are storing, if it's simple data, then go for the registry, if it's more complex, use an application data file.
[/quote]


  Right now it's all text data: numbers for RGB format colors, username/pass, connection port, server ip, etc (and the rest of the basic stuff you would expect to be able to set on a bot). - Like I said,:


[quote]  I think the most effective way of gathering the information that needs to be saved is a textbox control array; if you want to add more options, then just add the needed textbox and add/modify code to handle/read the extra data.[/quote]

Now back to the topic at hand:

  Registry: Is the more than one method of reading/writing to it? If so, then wich is better?

  Data file (.txt .ini etc.): Is the more than one method of reading/writing to each type of file? If so, then wich is better?  And wich format (.txt .ini etc) is the best?

  Please compair size of code vs speed.  Assume that the data that needs to be stored is the text from a textbox control array that is roughfly 100 long, each with text ranging anywhere from 1 to about 40-50 caraters long.
June 5, 2005, 3:55 AM
OnlyMeat
[quote author=Tontow link=topic=11769.msg114907#msg114907 date=1117943737]
Right now it's all text data: numbers for RGB format colors, username/pass, connection port, server ip, etc (and the rest of the basic stuff you would expect to be able to set on a bot). - Like I said,:
[/quote]

You can store that kind of information in either, but application data files have the added advantage that they are easily transferable across machines, and you can encrypt information if you see fit. However, using the registry allows you store information without any consideration of it's location on disk.

Both have different pros/cons, but with simple data like that you could use either.

[quote author=Tontow link=topic=11769.msg114907#msg114907 date=1117943737]
  Registry: Is the more than one method of reading/writing to it? If so, then wich is better?
[/quote]

Yes.  There are two methods as outlined below.

VB has built in application registry access functions in the form of SaveSetting()/GetSetting(). These are extremely simple to use and do the job.

Alternatively, you can use the raw API registry functions if you prefer greater control. These come in the form:-

RegOpenKey()
RegQueryValueEx()

etc...

Of course these are more complex to use, especially through vb. The built in vb functions make those calls internally, so you are infact calling the same API.

[quote author=Tontow link=topic=11769.msg114907#msg114907 date=1117943737]
  Data file (.txt .ini etc.): Is the more than one method of reading/writing to each type of file? If so, then wich is better?  And wich format (.txt .ini etc) is the best?
[/quote]

Yes. .txt and .ini are just file extensions. They mean nothing except to the operating system which associates them with programs. The 'PrivateProfile'  format can be used in any file, with any extension, .txt, .ini, .dat. what ever you like.

The PrivateProfile format in windows consists of the following elements:-

[SECTIONNAME]
KEY=VALUE

It's pretty simple. Windows has built in functions for reading and writing the values using this format.

Some of the functions used to do this:-

GetPrivateProfileString()
WritePrivateProfileString()

etc...

Note those are API functions, not built in vb ones.

As i mentioned, .txt files can contain anything, they don't have a specific format. If you choose to use your own format  rather than a PrivateProfile, then you must choose how the file is composed and implement custom parsing etc. obviously this requires more effort, and will probably be less efficient than using PrivateProfiles.

[quote author=Tontow link=topic=11769.msg114907#msg114907 date=1117943737]
Please compair size of code vs speed.  Assume that the data that needs to be stored is the text from a textbox control array that is roughfly 100 long, each with text ranging anywhere from 1 to about 40-50 caraters long.
[/quote]

Using PrivateProfiles will certainly be less code, and probably faster. The number of characters stored isn't an issue with PrivateProfile files, the OS takes care of all of that for you.
June 5, 2005, 10:04 AM
UserLoser.
[code]
Option Explicit

Public Enum e_KeyRoot
    HKEY_LOCAL_MACHINE = &H80000002
End Enum

Public Enum e_KeyAccess
    KEY_ALL_ACCESS = &HF003F
End Enum

Public Enum e_RegOption
    REG_OPTION_NON_VOLATILE = &H0
End Enum

Private m_KeyHandle As Long

Private Sub Class_Terminate()
    If (m_KeyHandle > 0) Then
        Call CloseKey
    End If
    m_KeyHandle = 0
End Sub

Public Property Get KeyHandle() As Long
    KeyHandle = m_KeyHandle
End Property

Public Function OpenKey(ByVal KeyRoot As e_KeyRoot, ByVal SubKey As String) As e_Win32Error
    OpenKey = RegOpenKeyEx(KeyRoot, SubKey, 0, KEY_ALL_ACCESS, m_KeyHandle)
End Function

Public Function CloseKey() As e_Win32Error
    CloseKey = RegCloseKey(m_KeyHandle)
End Function

Public Function CreateKey(ByVal KeyRoot As e_KeyRoot, ByVal SubKey As String) As e_Win32Error
    CreateKey = RegCreateKeyEx(KeyRoot, SubKey, 0, vbNullString, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, ByVal CLng(0), m_KeyHandle, 0)
End Function

Public Function EnumKey() As Collection
    If (m_KeyHandle > 0) Then
        Dim SubKeys As Long, LastWriteTime As FILETIME
        If (RegQueryInfoKey(m_KeyHandle, vbNullString, 0, 0, SubKeys, 0, 0, 0, 0, 0, 0, LastWriteTime) = ERROR_SUCCESS) Then
            Dim I As Long, KeyName As String
            Const MaxLength As Long = 256
            Set EnumKey = New Collection
            KeyName = Space$(MaxLength)
            For I = 0 To SubKeys - 1 Step 1
                If (RegEnumKeyEx(m_KeyHandle, I, KeyName, MaxLength, 0, vbNullString, 0, LastWriteTime) = ERROR_SUCCESS) Then
                    Call EnumKey.Add(KeyName)
                End If
            Next I
        End If
    End If
End Function
[/code]

RegQueryInfoKey was giving troubles a while ago, so I hardcoded MaxLength to 256.
June 6, 2005, 12:01 AM
Tontow
thankyou OnlyMeat, that is a near perfict reply and thanks UserLoser for the example.

Can anyone else best there replys?
June 7, 2005, 5:50 AM
Myndfyr
Well, I haven't read the replies.  Regarding registry/INI functions, you're going to lose the portability if you use GetPrivateProfileString anyway (if you're using the API functions to do it).

Beyond that, Microsoft's "Certified for Windows XP" guidelines require that you store user-specific data -- such as configuration settings -- within the registry or within the user's private profile/documents folders.  Specifically, data that is core to the functioning of the software, such as configuration settings, goes in the registry.

Don't know if that has any relevance for you whatsoever.
June 7, 2005, 6:50 AM
Dyndrilliac
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
June 7, 2005, 10:47 PM
OnlyMeat
[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

That is simply not true. You can store user specific settings in application data files. You can store user specific settings in C:\Documents and Settings\<USER>\Application Data\.

The shell even provides a platform independent interface to determine this directory:-

[code]
HRESULT SHGetSpecialFolderLocation(          HWND hwndOwner,
    int nFolder,
    LPITEMIDLIST *ppidl
);
[/code]

If you specify CSIDL_APPDATA, it will return the current user's Application Data directory. Alternatively you can use the directory for all users with CSIDL_COMMON_APPDATA.
June 8, 2005, 12:21 AM
Dyndrilliac
How is what I said not true? I said that you could use the registry to store user-specific settings, and that for this type of storage they would be the ideal method. Nothing more. I never said it was the only way. Using Application Data storage is ideal for databases, unique file formats and other things of that nature. Simple variable filling is best when used in conjunction with the registry.
June 8, 2005, 1:58 AM
OnlyMeat
[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

You are implying that you have to use the registry to store data when a system has multiple user accounts. This is simply not true, you can store user specific application data files or data files for all users, in exactly the same way the registry allows you to do this.
June 8, 2005, 3:19 AM
Dyndrilliac
I said "Ideally", meaning that this is generally accepted as the prefered way of doing it. Application Data is best used for things like databases or lists used by software. The Registry is for user-specific Value-to-Variable program settings.

I didn't imply anything other than what I have just stated. Anything other than that was purely imagined on your part.
June 8, 2005, 6:37 AM
OnlyMeat
[quote author=Dyndrilliac link=topic=11769.msg115205#msg115205 date=1118212643]
I said "Ideally", meaning that this is generally accepted as the prefered way of doing it. Application Data is best used for things like databases or lists used by software. The Registry is for user-specific Value-to-Variable program settings.

I didn't imply anything other than what I have just stated. Anything other than that was purely imagined on your part.
[/quote]

Incorrect again. There is no generally accepted as the prefered way of doing it. It's a choice the software designer makes based on data type/accessibility needs and other factors.

There is no strict policy of where you store data. It's purely a decision for the software developer. Suggesting that there is one prefered way of doing it is complete nonsense.

You should re-evaluate your comments before making false assertions.
June 8, 2005, 7:55 PM
hismajesty
I think the most speedy and efficient way would be to upload all your settings to a database on a russian (or equally far away) server, then download them when necessary. :)
June 8, 2005, 8:45 PM
NicoQwertyu
I think this is all a matter of preference.  This is your program, store the data it needs where ever you want.  Personally, I like to keep everything stored in the "main folder" , because I don't like being responsible for cleaning up the registry/other areas when the program is deleted.
June 8, 2005, 10:28 PM
Dyndrilliac
[quote author=OnlyMeat link=topic=11769.msg115225#msg115225 date=1118260513]Incorrect again. There is no generally accepted as the prefered way of doing it. It's a choice the software designer makes based on data type/accessibility needs and other factors.

There is no strict policy of where you store data. It's purely a decision for the software developer. Suggesting that there is one prefered way of doing it is complete nonsense.

You should re-evaluate your comments before making false assertions.
[/quote]

Look up such topics in any official Win32 programming documentation, the registry is the suggested way of storing simple program settings.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconmanagingapplicationsettings.asp

[quote="MSDN Documentation Library"]In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]

Owned. Stfu, k thx.
June 9, 2005, 12:30 AM
dRAgoN
If you take into account that some people like to reformat on a regular basis and are to lazy to resetup the program again, then useing a text based storage system would most likely be your best choice.

The most I would probably use the regestry for is maybe common crap, resolution/color depth, window size, folder locations and such things that wouldent need to be written by the common user.
June 9, 2005, 12:39 AM
OnlyMeat
Lets take a look at what you said originally shall we. You are implying here that all program settings should be stored in the registry when multiple user accounts exist on a system.

[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

My response was that this is a false assertion, and the storage location depends on many factors. As i demonstrated, non of which have anything to do with multiple user accounts.

Clearly you have no idea of what you are talking about.

[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
How is what I said not true? I said that you could use the registry to store user-specific settings, and that for this type of storage they would be the ideal method. Nothing more. I never said it was the only way. Using Application Data storage is ideal for databases, unique file formats and other things of that nature. Simple variable filling is best when used in conjunction with the registry
[/quote]

That's a complete lie. If you can't remember what you said originally, then look above at your previous post.

The data could be stored in either location. As i said it's a matter for the programmer to decide based on factors of data type/accessiblity/portabillity and others. If you consider how much easier it is to transfer application data files across machines, then for such bot data, using application data files would have a significant advantage.

The registry is useful for disposable settings, but important user information should be stored in application data files in my opinion.

[quote author=Dyndrilliac link=topic=11769.msg115205#msg115205 date=1118212643]
The Registry is for user-specific Value-to-Variable program settings.
[/quote]

Another false assertion, the registry can be used for local machine settings (All users) or user specific settings.

Clearly you have no idea of what you are talking about.

[quote author=Dyndrilliac link=topic=11769.msg115260#msg115260 date=1118277019]
Look up such topics in any official Win32 programming documentation, the registry is the suggested way of storing simple program settings.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconmanagingapplicationsettings.asp

[quote="MSDN Documentation Library"]In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]
[/quote]

Apart from the fact that those are guidelines and shouldn't be taken literally. You failed to include the rest of the text that went with that paragraph. Here is the full text, so you can gather the correct context of that statement:-

[quote="MSDN Documentation Library"]In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]
[quote][/quote]

Notice the bold section, those settings are disposable. Whereas important settings like cdkeys, account passwords etc are certainly not.

Do you have any of your own opinions on this subject or do you blindly follow random quotes from sources on the internet?

[quote author=Dyndrilliac link=topic=11769.msg115260#msg115260 date=1118277019]
Owned. Stfu, k thx.
[/quote]

Did you run out of false assertions?
The only thing you have left to say are unintelligent grunts?
June 9, 2005, 6:09 AM
Dyndrilliac
I see all your interested in doing is misinterpreting, misconstruing, and taking my posts out of context. Well that's fine, whatever floats your boat. But if that is all you're going to do then my side of the discussion ends here.

The fact is I'm right, and you're right, but your too ignroant to see it. Microsoft directly implies, suggests, and states that the way intended for storing program data which does not require a custom designed file format is to be done in the registry. When it comes down to it you can choose to do it differently; But we have standards for a reason. Imagine the chaos that would ensue if we didn't have the metric system, and all countries had different measuring units.

Oh, and all the arguments about how it's harder to move registry settings from machine to machine are bullshit. All you have to do is copy the *.reg file and double click it, Windows takes care of the rest. Not to mention, The registry is in the same location for all windows versions from 95 on up. Application Data is not.

If an admin or mod could close this so it doesn't result in continuous flames, that would be great.
June 9, 2005, 8:08 AM
LoRd
I prefer the registry over configuration files which clutter the program's directory.
June 9, 2005, 8:17 AM
Networks
I believe it should be based on your program. If you want users to edit the data through your program then the registry is a great choice for this. BitWise based storage methods are great if you have to much to be stored or you find it most efficient opposed to plain-text. And there's always the easy method in which you can use ini files using keys. I suggest plain-text methods if you don't care for users to edit the data directly. There isn't a most efficient method, you have to choose between some and base it upon how your program is going to work. For example Vanquish Bot v2.0's database is getting pretty big and I've been thinking about changing to a BitWise way since it will allow me to customize it a bit more and add new database functions and features. I don't personally like the registry since I like most my programs to be editted directly.
June 9, 2005, 2:42 PM
Adron
[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
Lets take a look at what you said originally shall we. You are implying here that all program settings should be stored in the registry when multiple user accounts exist on a system.

[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

My response was that this is a false assertion, and the storage location depends on many factors. As i demonstrated, non of which have anything to do with multiple user accounts.

Clearly you have no idea of what you are talking about.

[/quote]


Clearly you have no idea of what you are talking about.

Ideally you want to store user-specific program settings in the registry. Ideally. There are a multitude of reasons some settings might not be appropriate to store in the registry. If your settings don't fit (multiple kilobytes of data), or if have data files such as mailboxes, logotypes, signatures, templates, store those in a file in the user's profile directory.

Storing your settings in the registry allows computers with multiple users to not need a separate settings file per user per program. Storing your settings in the registry instead of in a separate file, you will reduce the number of files stored on the user's hard drive.

You are also using the standard Windows way of storing preferences, supported on Windows versions down to Windows 95 and Windows NT 3.5.




[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
[quote author=Dyndrilliac link=topic=11769.msg115205#msg115205 date=1118212643]
The Registry is for user-specific Value-to-Variable program settings.
[/quote]

Another false assertion, the registry can be used for local machine settings (All users) or user specific settings.

Clearly you have no idea of what you are talking about.
[/quote]

Clearly you have no idea of what you are talking about.

The registry is for user-specific Value-to-Variable program settings. Among other things. It would obviously have been different if he had said "The registry is only for ..."





[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
[quote author=Dyndrilliac link=topic=11769.msg115260#msg115260 date=1118277019]
Look up such topics in any official Win32 programming documentation, the registry is the suggested way of storing simple program settings.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconmanagingapplicationsettings.asp

[quote="MSDN Documentation Library"]In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]
[/quote]

Apart from the fact that those are guidelines and shouldn't be taken literally. You failed to include the rest of the text that went with that paragraph. Here is the full text, so you can gather the correct context of that statement:-

[quote="MSDN Documentation Library"]In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]
[quote][/quote]

Notice the bold section, those settings are disposable. Whereas important settings like cdkeys, account passwords etc are certainly not.
[/quote]

Notice how it says "and other items", where other items can includes settings such as cdkeys. Note that Windows stores its product ID in the registry, and that account passwords are stored in the registry (SAM).

Notice also that Dyndrilliac said "storing simple program settings", which excludes those settings that should be stored in files.

Notice also that guidelines are meant to be followed unless there is a specific reason not to follow them. You have not shown specific reasons for not following these guidelines.


June 9, 2005, 3:32 PM
OnlyMeat
[quote author=Dyndrilliac link=topic=11769.msg115287#msg115287 date=1118304498]
I see all your interested in doing is misinterpreting, misconstruing, and taking my posts out of context.
[/quote]

As far as i can see you are the one backtracking and clearly lieing about what you have said previously to lessen the impact of false assertions made.

As i already demonstrated, i'm not the one taking quotes out of context. Want me to remind you?

[quote="MSDN Documentation Library"]In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]

[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
[quote="MSDN Documentation Library"]In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]
[/quote]

[quote author=Dyndrilliac link=topic=11769.msg115287#msg115287 date=1118304498]
The fact is I'm right.
[/quote]

I have shown that to be incorrect in more than one of your posts. I suggest you review what you said again.

[quote author=Dyndrilliac link=topic=11769.msg115287#msg115287 date=1118304498]
But we have standards for a reason. Imagine the chaos that would ensue if we didn't have the metric system, and all countries had different measuring units.
[/quote]

You just shot yourself in the foot there. Metric is an explicit standard, there is no room for discussion on it. Unlike software guidelines offered by microsoft, which i might add describe disposable settings, not important user information.

[quote author=Dyndrilliac link=topic=11769.msg115287#msg115287 date=1118304498]
If an admin or mod could close this so it doesn't result in continuous flames, that would be great.
[/quote]

I'm the one flaming? Lets see :-

[quote author=Dyndrilliac link=topic=11769.msg115260#msg115260 date=1118277019]
Owned. Stfu, k thx.
[/quote]

[quote author=LoRd[nK] link=topic=11769.msg115288#msg115288 date=1118305052]
I prefer the registry over configuration files which clutter the program's directory.
[/quote]

You can store data files in the application directory, but like you said it creates clutter. Additionally with user permissions setup, the Programs directory may not be writeable.

A solution to this is to use the specific locations designated for application data in windows. The shell provides an interface to determine these directories at runtime.

You can see the entire post earlier in this thread for more information about it.
June 9, 2005, 7:04 PM
R.a.B.B.i.T
Let's all be quiet now?  A good debate is different from a fight, so how about we knock it off?
June 9, 2005, 8:04 PM
Dyndrilliac
I never once throughout this thread lied, or taken a quote out of context.

I would also like to point out that you did not respond to Adron's post.

I had to keep making my posts more specific because you kept being more critical as the arguement went on, misconstruing what I had said. You went so far as to imply that I had said the registry was the only way to store user-specific data.

[quote="OnlyMeat"][quote="Dyndrilliac"]Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.[/quote]

You are implying that you have to use the registry to store data when a system has multiple user accounts. This is simply not true, you can store user specific application data files or data files for all users, in exactly the same way the registry allows you to do this.[/quote]

Let's see. Storing in the registry DOES allow multi-user machines to store seperate settings without the need of a seperate file for each users settings. Nowhere did I imply that it was the only way to store user-personal settings. You are the one lieing, and taking things out of context.

[quote]In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.[/quote]

"program settings like window positions, files used, and other items". Interesting. I wonder what "other items" includes? Let's ask Adron.

[quote="Adron"]Notice how it says "and other items", where other items can includes settings such as cdkeys. Note that Windows stores its product ID in the registry, and that account passwords are stored in the registry (SAM).[/quote]

OnlyMeat: Clearly you have no idea what you are talking about.
June 9, 2005, 8:05 PM
OnlyMeat
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Storing your settings in the registry allows computers with multiple users to not need a separate settings file per user . Storing your settings in the registry instead of in a separate file, you will reduce the number of files stored on the user's hard drive.
[/quote]

I expected more from you adron. Obviously you aren't paying attention to this thread, because if you had you would have seen that i already established what you just said as incorrect. Want me to remind you?

[quote author=OnlyMeat link=topic=11769.msg115188#msg115188 date=1118190073]
If you specify CSIDL_APPDATA, it will return the current user's Application Data directory. Alternatively you can use the directory for all users with CSIDL_COMMON_APPDATA.
[/quote]

Clearly you haven't heard of the "C:\Documents and Settings\All Users\Application Data" directory specifically designated in windows for settings that apply to all local machine users.

Note the part below was your own addition onto the original statement by Dyndrilliac, which i excluded because you were changing the original context of my reply.

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
per program
[/quote]

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Clearly you have no idea of what you are talking about.
[/quote]

Want to re-evaulate that comment?

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
The registry is for user-specific Value-to-Variable program settings. Among other things. It would obviously have been different if he had said "The registry is only for ..."
[/quote]

I think you need to read the reply to the specific comment more carefully.

[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
[quote author=Dyndrilliac link=topic=11769.msg115205#msg115205 date=1118212643]
The Registry is for user-specific Value-to-Variable program settings.
[/quote]

Another false assertion, the registry can be used for local machine settings (All users) or user specific settings.
[/quote]

Clearly by itself that statement is saying the purpose of the registry is for user specific settings. I reply by stating the registry can be used for All User settings and user specific settings.

Do you understand now?


[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice how it says "and other items", where other items can includes settings such as cdkeys. Note that Windows stores its product ID in the registry, and that account passwords are stored in the registry (SAM).
[/quote]

Yes, like i said on many occasions in this thread, the developer decides where to store this information based on many factors. It could be stored in the registry this is true. But i personally believe in only storing disposable settings in  the registry. Windows can do what it likes, with it's own data.

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice also that Dyndrilliac said "storing simple program settings", which excludes those settings that should be stored in files.
[/quote]

If you didn't notice, that was his second post which backtracked on his first, which originally stated:-

[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

He makes no mention of simple program settings, or anything relating to the type of data.

I suggest you read the entire thread before making assumptions about what was said.

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice also that guidelines are meant to be followed unless there is a specific reason not to follow them. You have not shown specific reasons for not following these guidelines.
[/quote]

As i posted, those guidlelines only suggest disposable settings. Window sizes, file links etc. All things that can simply be reconstructed at runtime.

Guidelines are to help people make decisions about what course of action to take. I'll repeat, there are many factors involved. They shouldn't be taken as an explicit standard.

Now, is any of that not clear or would you like me to draw you a picture?
June 9, 2005, 8:11 PM
Adron
[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Storing your settings in the registry allows computers with multiple users to not need a separate settings file per user . Storing your settings in the registry instead of in a separate file, you will reduce the number of files stored on the user's hard drive.
[/quote]

I expected more from you adron. Obviously you aren't paying attention to this thread, because if you had you would have seen that i already established what you just said as incorrect. Want me to remind you?
[/quote]

I would appreciate if you made your best attempt to establish that what I just was incorrect.


[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=OnlyMeat link=topic=11769.msg115188#msg115188 date=1118190073]
If you specify CSIDL_APPDATA, it will return the current user's Application Data directory. Alternatively you can use the directory for all users with CSIDL_COMMON_APPDATA.
[/quote]

Clearly you haven't heard of the "C:\Documents and Settings\All Users\Application Data" directory specifically designated in windows for settings that apply to all local machine users.
[/quote]

I am quite familiar with that area. You may want to note that the name is "Application Data", not "Application Settings". You could also dive in there, and look at what you see. You may find an address book, icons for your Quick Launch Bar, cache files for MSN Messenger, or perhaps your own wordlist for Office's spellcheck. What you will not find are such bot-like settings as the proxy you have configured IE to use, the security settings for web sites, the cd key / product ID for Windows or any other plain settings.




[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
Note the part below was your own addition onto the original statement by Dyndrilliac, which i excluded because you were changing the original context of my reply.

[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
per program
[/quote]
[/quote]

Ah, yes, I used that to clarify a bit. You do not get an extra file per user per program to handle settings for them. The registry is already actually stored in a special file per user, but that file will exist whether you put your settings there or not. You may as well go ahead and put them there, and that way you'll not have to create a settings file per user.



[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Clearly you have no idea of what you are talking about.
[/quote]

Want to re-evaulate that comment?
[/quote]

It would seem to be quite accurate still.



[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
The registry is for user-specific Value-to-Variable program settings. Among other things. It would obviously have been different if he had said "The registry is only for ..."
[/quote]

I think you need to read the reply to the specific comment more carefully.

[quote author=OnlyMeat link=topic=11769.msg115284#msg115284 date=1118297379]
[quote author=Dyndrilliac link=topic=11769.msg115205#msg115205 date=1118212643]
The Registry is for user-specific Value-to-Variable program settings.
[/quote]

Another false assertion, the registry can be used for local machine settings (All users) or user specific settings.
[/quote]

Clearly by itself that statement is saying the purpose of the registry is for user specific settings. I reply by stating the registry can be used for All User settings and user specific settings.

Do you understand now?
[/quote]

I understood your comment fine. What I pointed out was that there's "if" and "iif" - "if" vs "if and only if". The registry is for user specific settings. It's also for machine specific settings. It's for all kinds of settings. That doesn't mean it's not for user specific settings.



[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice how it says "and other items", where other items can includes settings such as cdkeys. Note that Windows stores its product ID in the registry, and that account passwords are stored in the registry (SAM).
[/quote]

Yes, like i said on many occasions in this thread, the developer decides where to store this information based on many factors. It could be stored in the registry this is true. But i personally believe in only storing disposable settings in  the registry. Windows can do what it likes, with it's own data.
[/quote]

You may go on and hold your personal beliefs about storing settings in files, and there's nothing I can say about your holding them, but you should make it clear that you are not following the guidelines for writing Windows programs when you bring up your opinions.




[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice also that Dyndrilliac said "storing simple program settings", which excludes those settings that should be stored in files.
[/quote]

If you didn't notice, that was his second post which backtracked on his first, which originally stated:-

[quote author=Dyndrilliac link=topic=11769.msg115179#msg115179 date=1118184428]
Ideally you want to store user-sepcific program settings in the registry. This allows computers with multiple users to not need a seperate settings file for each user.
[/quote]

He makes no mention of simple program settings, or anything relating to the type of data.

I suggest you read the entire thread before making assumptions about what was said.
[/quote]

I have read the entire thread. There are special cases and exclusions from all rules. The general rule still is to store your user-specific program settings in the registry. Ideally you want to do that. Not everything works in an ideal way, among other things you shouldn't store huge blobs of data in the registry because of limitations in its design. We don't live in an ideal world.




[quote author=OnlyMeat link=topic=11769.msg115314#msg115314 date=1118347900]
[quote author=Adron link=topic=11769.msg115294#msg115294 date=1118331158]
Notice also that guidelines are meant to be followed unless there is a specific reason not to follow them. You have not shown specific reasons for not following these guidelines.
[/quote]

As i posted, those guidlelines only suggest disposable settings. Window sizes, file links etc. All things that can simply be reconstructed at runtime.

Guidelines are to help people make decisions about what course of action to take. I'll repeat, there are many factors involved. They shouldn't be taken as an explicit standard.

Now, is any of that not clear or would you like me to draw you a picture?
[/quote]

You have made it quite clear that you are of the opinion that people should use non-standard ways to store user settings. Actually that you recommend against following guidelines. I have noted your opinion.
June 9, 2005, 8:52 PM
OnlyMeat
[quote author=Adron link=topic=11769.msg115321#msg115321 date=1118350322]
You have made it quite clear that you are of the opinion that people should use non-standard ways to store user settings.
[/quote]

I have only to reply to this comment. My previous post says everything else.

I wasn't aware that guidelines were standards. Maybe you should take another look at their definitions:-

[url]http://www.google.co.uk/search?hl=en&q=define%3Astandard&btnG=Search&meta=[/url]
[url]http://www.google.co.uk/search?hl=en&q=define%3Aguideline&btnG=Search&meta=[/url]
June 9, 2005, 9:10 PM
Dyndrilliac
Guideline:[quote="www.dictionary.com"]A statement or other indication of policy or procedure by which to determine a course of action[/quote]

Standard:[quote="www.dictionary.com"] Something, such as a practice or a product, that is widely recognized or employed, especially because of its excellence.[/quote]

Let's simplify this. I took the liberty of getting the definitions of "practice" and "policy" as well. They also come from the same source (www.dictionary.com).

Guideline: "A statement of policy."
Standard: "Practice or product that is widely accepted."
Policy: A course of action, guiding principle, or procedure considered expedient, prudent, or advantageous.
Practice: To carry out in action; observe.

Well now. Isn't that something. Policy and practice can mean the same thing when referring to actions. A guideline is a policy, and a standard is a practice, and we are definitely talking about an action (Which method to use in programming), so there since we are referring to an action in this case standard and guideline do act as synonyms.
June 9, 2005, 9:26 PM
Adron
[quote author=OnlyMeat link=topic=11769.msg115322#msg115322 date=1118351453]
[quote author=Adron link=topic=11769.msg115321#msg115321 date=1118350322]
You have made it quite clear that you are of the opinion that people should use non-standard ways to store user settings.
[/quote]

I have only to reply to this comment. My previous post says everything else.
[/quote]

Yeah, your previous posts have clearly shown that you're all into weird opinions. We can agree on that.


[quote author=OnlyMeat link=topic=11769.msg115322#msg115322 date=1118351453]
I wasn't aware that guidelines were standards. Maybe you should take another look at their definitions:-

[url]http://www.google.co.uk/search?hl=en&q=define%3Astandard&btnG=Search&meta=[/url]
[url]http://www.google.co.uk/search?hl=en&q=define%3Aguideline&btnG=Search&meta=[/url]
[/quote]

I like to take my definitions from dictionaries, they tend to be clearer. Here we go:

[quote]
Main Entry: 1stan·dard
Pronunciation: 'stan-d&rd
Function: noun
Etymology: Middle English, from Old French estandard rallying point, standard, of Germanic origin; akin to Old English standan to stand and to Old English ord point -- more at ODD

...

3 : something established by authority, custom, or general consent as a model or example
[/quote]

So, a standard is a model or example of how things should be / typically are.



[quote]
Main Entry: guide·line
Pronunciation: 'gId-"lIn
Function: noun
...
b : an indication or outline of policy or conduct 
[/quote]

So, guidelines are a collection of outlines of policy/conduct.


[quote]
Main Entry: 1pol·i·cy
Pronunciation: 'pä-l&-sE
Function: noun
Inflected Form(s): plural -cies
Usage: often attributive
Etymology: Middle English policie government, policy, from Middle French, government, regulation, from Late Latin politia

...

b : a high-level overall plan embracing the general goals and acceptable procedures especially of a governmental body
[/quote]

So, policy is a high-level plan to reach general goals / follow acceptable procedures.

Combine that with previous definitions and find that guidelines are outlines of acceptable procedures for accomplishing goals, while standards are models/examples of how things should be or typically are. This means that guidelines create standards, or ways to follow standards are described by guidelines. They are not synonyms, but different parts of the same concept: Doing 1. what everyone else does and 2. what should be done.

June 10, 2005, 11:20 PM
St0rm.iD
Uh...

OnlyMeat, if your statements are true, then why does the registry exist...?
June 11, 2005, 1:59 AM
Dyndrilliac
[quote author=Banana fanna fo fanna link=topic=11769.msg115403#msg115403 date=1118455165]
Uh...

OnlyMeat, if your statements are true, then why does the registry exist...?
[/quote]

My thoughts exactly, and what I've been trying to get across this whole time.
June 11, 2005, 2:27 AM
DarkMinion
This is the most useless argument I've seen in a great while.  It's all a matter of preference, nothing more.  Do yourselves a favor and drop it now before someone ends up getting banned.
June 11, 2005, 9:03 PM

Search