FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Working through the tutorial.

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
dcoder



Joined: 04 May 2010
Posts: 5

PostPosted: Fri May 07, 2010 1:44 pm    Post subject: Working through the tutorial. Reply with quote

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
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon May 10, 2010 2:43 pm    Post subject: Re: Working through the tutorial. Reply with quote

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
View user's profile Send private message AIM Address
dcoder



Joined: 04 May 2010
Posts: 5

PostPosted: Mon May 24, 2010 4:28 pm    Post subject: Reply with quote

Thanks for the reply. Sorry for the late follow up, busy. Sad

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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