SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    May 2007
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Retain user specific val after TP shutdown/restart

    Is there a way to retain a value that the user enters into a form indefinately? (like in a variable?)
    I want to prompt the user for a location to store their files, and retain that information for all future runs.
    The only way that I can construe is a file on the hard drive that contains this information.
    i.e.

    if fileexists(resultFile) = false then
    frmUserPrompt.show
    desiredVar = frmUserPrompt.txtUserEntry
    resultFile.writeline (desiredVar)
    end if

    Any other ideas?
    Disclaimer: I am forever a newbie!

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    Manchester
    Posts
    255
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retain user specific val after TP shutdown/restart

    That's the easiest way. Another way is to use environment variables but there's no advantage to be gained from this method and it's more difficult - they're discussed in a number of threads including here
    Rob

  3. #3
    Advanced Member
    Join Date
    May 2007
    Posts
    609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Retain user specific val after TP shutdown/restart

    I recommend saving this info to the registry. Use the SaveSetting / GetSetting / DeleteSetting commands to do this. This example sets a key, reads the value back, then deletes the key.

    SaveSetting "TestPartner", "Settings", "FileLocation", "C:\Compuware\TestPartner\DataFiles"
    MsgBox GetSetting("TestPartner", "Settings", "FileLocation")
    DeleteSetting "TestPartner"
    MsgBox GetSetting("TestPartner", "Settings", "FileLocation")

    Hope this helps,
    db

    Edit: From what I could tell, this will be user-specific because it is stored in HKEY_CURRENT_USER\Software\VB and VBA Program Settings.
    Dennis Belew

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:50 PM.

Copyright BetaSoft Inc.