Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Change the value of a double (help)? Posted by GUI_Matt on 20 Jul 2012 at 3:09 PM
I wanted to know how to change the value of a double in code, not by manually typing in the value. Example: If i set the value of double hi to 50, I'd type in a line of code to change it to 60 permantly. So if i run it, close it and run it again, the value will stay 60. Please help.
Report
Re: Change the value of a double (help)? Posted by MrShadov on 22 Aug 2012 at 12:49 AM
-removed repost-
Report
Re: Change the value of a double (help)? Posted by MrShadov on 22 Aug 2012 at 12:51 AM
The best way I can think of doing that would be having an external file to hold the value of variable(s) you want. Read from the file and assign to whichever variable(s) you want. Then simply rewrite the file with the new value(s). This way, the new value is always assigned to your variables each time you run your program. And always remember to close out the file at the end of program execution!
Report
Re: Change the value of a double (help)? Posted by MrShadov on 22 Aug 2012 at 12:54 AM
The best way I can think of doing that would be having an external file to hold the value of variable(s) you want. Read from the file and assign to whichever variable(s) you want. Then simply rewrite the file with the new value(s). This way, the new value is always assigned to your variables each time you run your program. And always remember to close out the file at the end of the program!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.