1. stdout not working as expected under "cmd" in Windows XP
- Posted by eujeth Jul 12, 2010
- 1046 views
I've created an extremely simple Euphoria program that looks like this:
C:\EUPHORIA\DEMO>type b1.ex
puts(1, "this is a test\n")
printf(1, "%s", "this is another test\n")
I run "cmd" under Windows XP, set PATH and EUPATH correctly and then try to "ex b1.ex":
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd c:\EUPHORIA
C:\EUPHORIA>set PATH=%PATH%;C:\EUPHORIA\BIN
C:\EUPHORIA>set EUPATH=C:\EUPHORIA
C:\EUPHORIA>cd DEMO
C:\EUPHORIA\DEMO>ex b1.ex
this is a test
t
C:\EUPHORIA\DEMO>
Why am I not seeing the two sentences I'm outputting? The same happens when running under "command" instead of "cmd".
2. Re: stdout not working as expected under "cmd" in Windows XP
- Posted by jimcbrown (admin) Jul 12, 2010
- 1032 views
I've created an extremely simple Euphoria program that looks like this:
C:\EUPHORIA\DEMO>type b1.ex
puts(1, "this is a test\n")
printf(1, "%s", "this is another test\n")
I run "cmd" under Windows XP, set PATH and EUPATH correctly and then try to "ex b1.ex":
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd c:\EUPHORIA
C:\EUPHORIA>set PATH=%PATH%;C:\EUPHORIA\BIN
C:\EUPHORIA>set EUPATH=C:\EUPHORIA
C:\EUPHORIA>cd DEMO
C:\EUPHORIA\DEMO>ex b1.ex
this is a test
t
C:\EUPHORIA\DEMO>
Why am I not seeing the two sentences I'm outputting? The same happens when running under "command" instead of "cmd".
Try this:
puts(1, "this is a test\n")
printf(1, "%s", {"this is another test\n"})
3. Re: stdout not working as expected under "cmd" in Windows XP
- Posted by eujeth Jul 12, 2010
- 1028 views
I've created an extremely simple Euphoria program that looks like this:
C:\EUPHORIA\DEMO>type b1.ex
puts(1, "this is a test\n")
printf(1, "%s", "this is another test\n")
I run "cmd" under Windows XP, set PATH and EUPATH correctly and then try to "ex b1.ex":
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Administrator>cd c:\EUPHORIA
C:\EUPHORIA>set PATH=%PATH%;C:\EUPHORIA\BIN
C:\EUPHORIA>set EUPATH=C:\EUPHORIA
C:\EUPHORIA>cd DEMO
C:\EUPHORIA\DEMO>ex b1.ex
this is a test
t
C:\EUPHORIA\DEMO>
Why am I not seeing the two sentences I'm outputting? The same happens when running under "command" instead of "cmd".
Try this:
puts(1, "this is a test\n")
printf(1, "%s", {"this is another test\n"})
Ahhhhh... *now* get it. Thanks!
(Possibly) related questions:
1) Where does stdout go when I run my program under exw instead of ex (again, from within a cmd window)? What am I not understanding about the difference between ex and exw? Is exw *only* for running a program which does Windows graphics?
2) Back to "ex b1.ex"... it works fine in a "vanilla" cmd window. But if I mess with the "color" subcommand at all under cmd, then my Euphoria program prints the right number of characters, but they're "solid black background" (i.e. you can't see the characters themselves because they're foreground black in background black)... to see them I need to run "color", and that magically turns off the background color for what was just output. Not sure what's going on, there.
4. Re: stdout not working as expected under "cmd" in Windows XP
- Posted by jimcbrown (admin) Jul 12, 2010
- 1053 views
1) Where does stdout go when I run my program under exw instead of ex (again, from within a cmd window)? What am I not understanding about the difference between ex and exw? Is exw *only* for running a program which does Windows graphics?
It goes to a new command line window, which probably promptly closes too fast to notice that it ever existed. Try this at the end of your program:
include get.e integer z z = wait_key()
exw and exwc are Windows, and ex is MSDOS.
2) Back to "ex b1.ex"... it works fine in a "vanilla" cmd window. But if I mess with the "color" subcommand at all under cmd, then my Euphoria program prints the right number of characters, but they're "solid black background" (i.e. you can't see the characters themselves because they're foreground black in background black)... to see them I need to run "color", and that magically turns off the background color for what was just output. Not sure what's going on, there.
Look into text_color() and bk_color()
5. Re: stdout not working as expected under "cmd" in Windows XP
- Posted by eujeth Jul 12, 2010
- 1098 views
1) Where does stdout go when I run my program under exw instead of ex (again, from within a cmd window)? What am I not understanding about the difference between ex and exw? Is exw *only* for running a program which does Windows graphics?
It goes to a new command line window, which probably promptly closes too fast to notice that it ever existed. Try this at the end of your program:
include get.e integer z z = wait_key()
exw and exwc are Windows, and ex is MSDOS.
2) Back to "ex b1.ex"... it works fine in a "vanilla" cmd window. But if I mess with the "color" subcommand at all under cmd, then my Euphoria program prints the right number of characters, but they're "solid black background" (i.e. you can't see the characters themselves because they're foreground black in background black)... to see them I need to run "color", and that magically turns off the background color for what was just output. Not sure what's going on, there.
Look into text_color() and bk_color()
Excellent. Thanks much, Jim!