Writing an integer to a file

%u yochib at gmail.com
Mon Mar 7 04:11:34 PST 2011


this is part of the code:

void WritePushPop(cmd command, string segment, int index)
		{
                        string temp = "TextFile.Asm";
			AsmFile = new File(temp, FileMode.OutNew );

		        string x = toString(index);

AsmFile.writeString("@");

AsmFile.write(index);

AsmFile.writeLine("D=A");

AsmFile.writeLine("@0");

AsmFile.writeLine("A=M");

AsmFile.writeLine("M=D");

AsmFile.writeLine("D=A+1");

AsmFile.writeLine("@0");

AsmFile.writeLine("M=D");


}

Now it wouldn't even build, it doesn't like the line: string x =
toString(index);
but this line works when I'm working with the console.


Thanks!



More information about the Digitalmars-d-learn mailing list