Dafny in Visual Studio Professional 2012

Oct 23, 2013 at 10:14 AM
Edited Oct 23, 2013 at 4:37 PM
Hi,
I'm starting using Dafny. When I compiled a Dafny program, finished by

method TestM(d: int)
{
var r := M(d);
print "dato=", d, ", resultado=", r, "\n";
}

method Main()
{
TestM(180);
}

the .cs file is ended by the code

public void @TestM(BigInteger @d)
{
TAIL_CALL_START: ;
var _this = this;
BigInteger @_1_r = new BigInteger(0);
BigInteger _out0;
(_this).@M(@d, out _out0);
@_1_r = _out0;
System.Console.Write("dato=");
System.Console.Write(@d);
System.Console.Write(", resultado=");
System.Console.Write(@_1_r);
System.Console.Write("\n");
}
public void @Main()
{
TAIL_CALL_START: ;
var _this = this;
(_this).@TestM(new BigInteger(180));
}
public static void Main(string[] args) {
@__default b = new @__default();
b.Main();
}
}

When executing the .exe, it opens the console window and closes it inmediatly, so I cannot check the printed results. Please, could anyone tell me what could I do in the dafny program to keep the C# console window open?
Thanks,
Paqui Lucio
Developer
Oct 28, 2013 at 8:11 AM
Hi,

I don't think there is currently a nice way of preventing this. As a workaround you could add an infinite loop at the end of your main method.

Best regards,

Valentin
Oct 28, 2013 at 9:29 AM

Thanks,

Paqui

De: wuestholz [email removed]
Enviado el: lunes, 28 de octubre de 2013 9:12
Para: [email removed]
Asunto: Re: Dafny in Visual Studio Professional 2012 [dafny:463247]

From: wuestholz

Hi,

I don't think there is currently a nice way of preventing this. As a workaround you could add an infinite loop at the end of your main method.

Best regards,

Valentin