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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Registry Entries

Status
Not open for further replies.

capone67

Programmer
Nov 6, 2000
115
CA
Hi Gang

The current project I am working on stores some information in registry keys. Is there a way to store an array of values in the registry? Moree specifically my program keeps track of the last IP you logged in to with the program and I would like to have a drop down list of the last 5 or 10 IPs that were logged in to.

Here is the code I am currently using to access the registry, where Text1 is the input field for the IP addy to connect to.

SaveSetting "VideoworX", "Startup", "KioskAddy", Text1.Text

and

Text1.Text = GetSetting("VideoworX", "Startup", "KioskAddy", "")
 
If you can identify a delimiter character that you're certain will never occur in your list of values, you could use Join() to combine a number of values from an array into one string and store that in the registry. You would then retrieve the value and use Split() to break it up into an array again.

Otherwise, you'll probably have to store the values in separate keys with different number suffixes, as Microsoft does with its MRU lists.

It would be cool if you could just pass an array of keys and values, though. Why not write a procedure that handles it for you? (Actually, a pair of procedures: one to save and one to retrieve.) Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top