Posted 17 years ago on 12/29/2007 and updated 6/12/2008
Take Away: ObjectPAL methods for using the Window's registry to store and retrieve configuration settings.
KB100770
Two popular techniques for storing configuration information is to use initialization (.INI) files and the Windows registry. Both the older INI files and the newer registry are still used today but Microsoft recommends using the registry over INI files. The registry holds information about the computer hardware configuration, installed software, settings, preferences, and file associations. Should I still use .INI files in 32-bit Windows? You bet. However, use them sparingly. Your first choice for information about your software should be the registry and only when you run into a reason not to use the registry should you use initialization files.
Registry Methods
The preferred method of storing software information is to use the registry. ObjectPAL offers several methods for manipulating the registry including setRegistryValue(), getRegistryValue(), deleteRegistryValue(), searchRegistry(), and enumRegistryKeys().
Using setRegistryValue() and getRegistryValue()
The setRegistryValue() method sets a value in the registry. Here is the syntax:
setRegistryValue ( const key String, const value String, const data AnyType, const rootKey LongInt) Logical
If either the key or value do not exist, it will be created.
The rootKey is analogous to a directory drive. The rootKey should be set with the predefined constants: regKeyCurrentUser, regKeyClassesRoot, regKeyLocalMachine, or regKeyUser.
The following example sets the current ObjectPAL level in the registry.
Notice that the syntax for getRegistryValue() shows that it returns a value of type AnyType, sLevel is of type string because we knew ahead of time what the return type would be. If you don't, then return the value to a variable of type AnyType. Setting and retrieving values from the Windows registry is easy with Paradox.
<p>a real gem of information - it didn&#39;t even occur to me that&nbsp;OPAL had ready access tothe registry.</p><p>thanks for the article Mike</p>
Paradox has shared all about the registry. Now it will get easier for us to proceed with this method. You need to check essaygeeks.co.uk reviews that help to write the best essay for college. To face the challenges of life, education is a must that makes a man strong and worthy in all aspects.