Just wondering...

Brainwave7
01-15-2002, 08:27 AM
Can you have the user input a variable, and then store it in the program so that it is still there when you quit the program.

Flyguy
01-15-2002, 08:30 AM
If it's not too much data you could use the registry function:
SaveSetting() and GetSetting()
Otherwise you could store the data in a file.

Ranger
01-15-2002, 08:31 AM
You can save it to the registry using:

  SaveSetting appname, section, key, value

i.e.

  SaveSetting "myProg", "UserVariables", "Name", "Bob"

orufet
01-15-2002, 08:41 AM
You have the following options:


1) Store the data in the Registry
A) Built in VB functions
a)GetSetting()
b)SaveSetting()
c)DeleteSetting()
d)GetAllSettings()
B) API Calls
a)RegCreateKey
b)RegSaveKey
c)RegOpenKey
d)...
2) Store the data in a text file
A) Open Statment
B) FileSystemObject
C) .LoadFile() of RTB
3) Store the data in an ini file
A) GetPrivateProfileString
B) WritePrivateProfileString
C)...

Brainwave7
01-15-2002, 03:05 PM
What is the setting and the key in the SaveSetting command?

Flyguy
01-15-2002, 03:20 PM
Originally posted by Ranger
You can save it to the registry using:

  SaveSetting appname, section, key, value

i.e.

  SaveSetting "myProg", "UserVariables", "Name", "Bob"

Brainwave7
01-15-2002, 03:36 PM
OK, so how do you use the get function to use the value when u r done storing it?

Brainwave7
01-15-2002, 03:56 PM
Anybody here?
Reply?
Please?

:(

Flyguy
01-15-2002, 03:59 PM
Did you try the help? (F1)

It's almost using the same arguments as savesetting!

reboot
01-15-2002, 03:59 PM
savesetting and getsetting are native VB, hence documented quite well in the help.

[edit]

I think ArnoutV is my long lost twin or something. We keep posting nearly the same replies at the same time. :p

[edit]

Brainwave7
01-15-2002, 04:51 PM
I have the working model edition, there is no F1 help! :(

KesleyK
01-15-2002, 05:05 PM
A search on this forum should also have turned up:

GetSetting(appname, section, key, default)

The default is optional.

Ales Zigon
01-15-2002, 05:08 PM
Maybe this will clear the mistery:

If you use this:
SaveSetting "myProg", "UserVariables", "Name", "Bob"
to store string variable containing "Bob" to the registry, you can later retrieve it like this:
Dim strUserName AsString
strUserName=GetSetting ("myProg", "UserVariables", "Name")
It will retrieve the value "Bob", you have stored in the registry under the key "Name".

Brainwave7
01-16-2002, 07:56 AM
Thanks for all your help! :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum