[SOLVED] Writing variables into a textfile

Started by Matti, Thu 29/01/2009 12:19:10

Previous topic - Next topic

Matti

I know how to save text to an extern .txt file and I know how to save ints but is it possible to save ints as a written text? I want to know how the NPCs in my RPG develop throughout the game and it would be very handy if I could just look at a saved textfile after playing to see the character values written down.

WriteRawLine(string text) doesn't let you include variables and WriteInt can't be used with a textfile, so is there any other way?

Khris

Use:
  f.WriteRawLine(String.Format("The int has a value of %d.", a));


monkey0506

Khris is 100% correct. Just for reference, any function that doesn't directly support string formatting can always accept String.Format as a parameter instead.

Matti


SMF spam blocked by CleanTalk