|
-
Jul 1st, 2000, 03:33 AM
#1
Hey all,
I'm really having trouble working out how to use GetSetting. I've read tutorials, articles, but I can't seem to understand any of them fully. I want to be able to read a key, and get its value. And I'm not sure, but is GetSetting only able to read a value saved by SaveSetting? If this is true, how can I read values that were not written with SaveSetting?
Thanks,
Sunny
-
Jul 1st, 2000, 05:21 AM
#2
Fanatic Member
What you are looking for is in this thread.
http://forums.vb-world.net/showthrea...threadid=21286
If you learn how to manipulate the registry with API, you don't even have to touch GetSetting and SetSetting because API are much more powerful to use.
Chemically Formulated As:
Dr. Nitro
-
Jul 1st, 2000, 08:59 AM
#3
GetSetting and SaveSetting will only save in a specific path. As Nitro said, API is more powerful.
Anyhow, try this example, if you still want to use them. Put this in a CommandButton. It should print MyData on your Form.
Code:
SaveSetting "MyApp", "MySection", "MyValue", "MyData"
RetVal = GetSetting("MyApp", "MySection", "MyValue", "MyData"
Print RetVal
-
Jul 1st, 2000, 09:13 AM
#4
_______
my example of using save settings..
'I use this to show or not show a nag screen
'in the true event( option button or whatever the user uses to
'do whatever based on how it was last saved.
'if the value is true I show the nag screen
'if the user selected to not show it then it is false
'and my app bypasses the nag screen
'appname is LottoGenerator, nag screen is Splash, I check on startup of app
SaveSetting appname:="LottoGenerator", _
section:="Startup", _
Key:="Splash", _
setting:="True"
'=============================================
'in the false event
SaveSetting appname:="LottoGenerator", _
section:="Startup", _
Key:="Splash", _
setting:="False"
'==============================================
'in the load event
If GetSetting(appname:="LottoGenerator", section:="Startup", _
Key:="Splash") = "True" Then
'your code...do whatever
End If
'if it's false then leave it alone...no code
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jul 1st, 2000, 03:39 PM
#5
transcendental analytic
SaveSetting And GetSetting puts all your settings in a subkey with the apps name in
HKEY_CURRENT_USER\Software\VB and VBA Program Settings
If you want your settings stored in your own key you could download my registry module on my homepage and use Regval property to set and get registry values.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jul 1st, 2000, 07:40 PM
#6
Yes, Nitro has already given a link to the API method.
http://forums.vb-world.net/showthrea...threadid=21286
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|