• Post Reply Bookmark Topic Watch Topic
  • New Topic

Saving integers in property files.

 
Adam Miszczak
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm working on a save system for my game, and everything is fine. However, I need to save some variables to a properties file, which are integers. However setProperty does not allow saving integers. I am asking how to write the int into the file without modifying it too much. Is this possible? I tried casting, but that does not seem to work. I think I need to parse the variables in some way, but I am clueless on how to do that.

Here is my code:



Thanks!
 
Carey Brown
Bartender
Posts: 2261
28
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First convert int to String
Integer.toString( var )
 
Adam Miszczak
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. That works perfectly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!