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!