Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving...

Status
Not open for further replies.

The

Programmer
Jul 30, 2001
92
CA
I need a code that will save something. I need to save the user's progress in a simple game I'm making...can anyone help?
 
SaveSetting and GetSetting will save items to the registry and get them back later. VB Help give full details but here is quick idea

SaveSetting appname, section, key, value

The following code saves new values for the Backup and LastEntry keys in the Startup section of the registry for an application named "RegCust." This code assumes that the variables strDate and intLastEntry contain the new values.

Private Sub Form_Unload(Cancel As Integer)
SaveSetting "RegCust", "Startup", "Backup", strDate
SaveSetting "RegCust", "Startup", "LastEntry", intLastEntry
End Sub

If an entry for the application "RegCust" or any of these sections or keys don't exist in the Software/Microsoft section in the registry, this code will create it.

To get it back use GetSetting


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top