Thread overview
VisualD Console WIndow Disappears
Feb 15, 2012
RedShift
Feb 15, 2012
Bernard Helyer
Feb 15, 2012
Matthias Pleh
Feb 15, 2012
Alf P. Steinbach
Feb 15, 2012
Rainer Schuetze
February 15, 2012
So, I'm just starting to get into D, using the extension for VS called Visual D. Is there any way to stop the console from disappearing like in C++? Like C + F5 (which doesn't seem to work). Or like a getline?
February 15, 2012
On Wednesday, 15 February 2012 at 07:27:56 UTC, RedShift wrote:
> So, I'm just starting to get into D, using the extension for VS called Visual D. Is there any way to stop the console from disappearing like in C++? Like C + F5 (which doesn't seem to work). Or like a getline?

Just pop a stdin.readln call at the bottom of your program?
February 15, 2012
On 15.02.2012 08:27, RedShift wrote:
> So, I'm just starting to get into D, using the extension for VS called
> Visual D. Is there any way to stop the console from disappearing like in
> C++? Like C + F5 (which doesn't seem to work). Or like a getline?

This sort of question is better fittet in d.D.learn newsgroup,
but anyway, I think this helps:


import std.stdio;
import std.c.stdlib;  // import for system

int main(string[] argv)
{
    writeln("Hello D-World!");
    system("PAUSE");
    return 0;
}


^^Matthias
February 15, 2012
On 15.02.2012 08:27, RedShift wrote:
> So, I'm just starting to get into D, using the extension for VS called
> Visual D. Is there any way to stop the console from disappearing like in
> C++? Like C + F5 (which doesn't seem to work). Or like a getline?

This absolutely seems like a bug in Visual D, as does the resource include path thing.

Apart from changing the source code, which I guess you have considered and don't want to do, you still have these two more normal options:

  * Run the program from the Windows command line <g>, or

  * Set a breakpoint on the closing brace of `main`, and run
    the program in the debugger (e.g. keypress [F5]). When it
    hits the breakpoint at the end, use [Alt Tab] to go back
    to the program's console window.

For the first option, note that you can right click an editor tab in Visual Studio and fire up an Explorer window for that folder.

From the Explorer window it's then a very short journey to a command prompt: hold down Shift and right-click the relevant folder (I guess that would be a Debug binaries folder), and in Windwoes 7 choose "Open command window here".


Cheers & hth.,

- Alf
February 15, 2012

On 15.02.2012 12:20, Alf P. Steinbach wrote:
> On 15.02.2012 08:27, RedShift wrote:
>> So, I'm just starting to get into D, using the extension for VS called
>> Visual D. Is there any way to stop the console from disappearing like in
>> C++? Like C + F5 (which doesn't seem to work). Or like a getline?

As far as I know, the pause happens in C++ only when running without a debugger. Version 0.3.30 has an option in the debugger settings to also add this pause.

>
> This absolutely seems like a bug in Visual D, as does the resource
> include path thing.

The resource include works for me, but I am not sure why. This is part of the generated command line:

rc /fo..\bin\Debug\obj\visuald.res /IC:\Program /IFiles\Microsoft /ISDKs\Windows\v7.0\\include visuald.rc

I'll fix it...