Results 1 to 6 of 6

Thread: GetSetting help

  1. #1
    Guest
    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

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    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

  3. #3
    Guest
    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

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    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

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  6. #6
    Guest
    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
  •  



Click Here to Expand Forum to Full Width