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

How to store a double in the registry

Status
Not open for further replies.

n2jesus

Programmer
May 20, 2003
66
US
OK, I know this might be simple, but I can't figure it out. I need to store a double like 1.03 in the registry. It will populate a textbox on startup, and will save to the registry on exit.

I've tried writing it as a string which works, but when I try to read it back in, I get a blank string.

Any thoughts would be appreciated.

Jim
 
You could save the double as a string with Convert.toString (double) and store it in the registry. When you pull the string back out from the registry use Convert.toDbouble (string) to turn the string back into a double.
 
Yeah, that's what I was doing. I finally got it working. For some reason when the program loads, half way through loading info from the registry, it jumps to saving info to the registry. I moved the parameters I was working with to above that jump point in the code, and all works fine.

Still not sure why it jumps though.

Thanks for you input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top