View previous topic :: View next topic |
Author |
Message |
dcoder
Joined: 04 May 2010 Posts: 5
|
Posted: Fri May 07, 2010 1:44 pm Post subject: Working through the tutorial. |
|
|
Hello. First time poster to dsource.org and I hope to learn this pretty cool language. Anyways,
I am working through the 'Fundamental Section' of the dsource.org tutorial.
I compiled the quadratic example
http://dsource.org/projects/tutorials/wiki/QuadraticEquationExample
the example works, but, it the writef's don't get printed in a timely manner. I basically enter 3 numbers on a blank screen, hit enter, and then I see the prompts.
What do I do to this example so that it can print the prompts?
I am using
$ dmd --help
Digital Mars D Compiler v2.042
Copyright (c) 1999-2010 by Digital Mars written by Walter Bright
Documentation: http://www.digitalmars.com/d/2.0/index.html
Thanks!! |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Mon May 10, 2010 2:43 pm Post subject: Re: Working through the tutorial. |
|
|
dcoder wrote: | Hello. First time poster to dsource.org and I hope to learn this pretty cool language. Anyways,
I am working through the 'Fundamental Section' of the dsource.org tutorial.
I compiled the quadratic example
http://dsource.org/projects/tutorials/wiki/QuadraticEquationExample
the example works, but, it the writef's don't get printed in a timely manner. I basically enter 3 numbers on a blank screen, hit enter, and then I see the prompts.
What do I do to this example so that it can print the prompts?
I am using
$ dmd --help
Digital Mars D Compiler v2.042
Copyright (c) 1999-2010 by Digital Mars written by Walter Bright
Documentation: http://www.digitalmars.com/d/2.0/index.html
Thanks!! |
I just checked it, and it works fine for me under Windows XP with Digital Mars D Compiler v2.045.
Are you using Linux? I haven't tested any of the tutorial samples in Linux or MacOS, so I don't know that they work properly on other platforms.
You might try changing the "writef" commands to "writefln" and see if that improves the situation. I think I've read that Linux doesn't automatically flush the input buffer to the screen (or something like that).
(If the issue is platform-related, I'd like to make the sample program cross-platform or at least add a note about the issue.) |
|
Back to top |
|
|
dcoder
Joined: 04 May 2010 Posts: 5
|
Posted: Mon May 24, 2010 4:28 pm Post subject: |
|
|
Thanks for the reply. Sorry for the late follow up, busy.
Anyways, you are right, it works I am using Windows XP, and when I run it from a dos prompt, it works. I get the prompts asking for a,b, and c when I expect them.
However, when I run it using cygwin, (where I initially encountered the problem), I get the problem I initially described.
So, here's what I do:
1. compile quadratic equation using dmd in my dos prompt and save it to the directory: C:\dsource\tutorials\QuadraticEquation.exe
2. run the quadratic program from dos prompt. GOOD.
3. type bash, a cygwin program, run the program. GOOD.
4. Open an xwindow (cygwin). cd to:
/cygdrive/c/dsource/tutorials
5. Run quadratic program. BAD.
6. Now compile program in xwindows under
/home/me/QuadraticEquation.exe
7. Run it under Xwindows. BAD.
8. Open up a dos prompt, and go to /cygwin/home/me
run quadratic equation. GOOD.
So, this is probably not a D programming issue? It's either my bash shell or something particular to x windows?
You have any suggestions? thanks. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|