Int to string (Please ignore me, self solved)

Started by WHAM, Wed 10/08/2011 19:39:05

Previous topic - Next topic

WHAM

I was hoping to record certain information into the save game header.
I wanted to see if I could create a customized save/load GUI again, and thought I'd do the following:

Create a string, then append the data, such as current date, time, and some gameplay values, which are stored as "int" -values.

Then I realized: there are several ways in the manual to convert string into almost anything, but an int value can only be converted into a float as far as I can tell.

Is there even a way to do something like this (this obviously does not work):
Code: ags

string taa = "Month %d:%d Day - Clock: %d:%d", dt.Month, dt.DayOfMonth, globalhours, globalminutes;

or maybe something like:
Code: ags

string poo = convertinttostring(dt.Month); 
string taa = append.taa(poo);


EDIT: Never, bloody, mind! It happened again: I ask, and two minutes later I stumble on the answer by accident and realize I had used the wrong search parameters in the manual.

The answer: String.Format
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Wyz

(for the record)
Yes, and for the other way around use:
Code: ags

String str = "128";
int i = str.AsInt;
float f = str.AsFloat;
Life is like an adventure without the pixel hunts.

SMF spam blocked by CleanTalk