|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: May 2000
Location: Asia-Singapore
Posts: 461
|
Borland C++ , version 5.02 running on win98se, I just wrote a simple program to sum up two numbers (Ya , I know , it's a bit...)But the output was no where to be found ? Then I realised that I have to actually go to the particular directory in dos mode and run the program execution file in order to get the results, can't I get the results in the message panel just below my current editor panel ?
moonlight burner |
|
|
|
|
|
#2 |
|
Member (12 bit)
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
|
Well, you can make the DOS window that the program will execute in (as it seems you're writing a DOS-based program) stay until you hit a key, by including this code:
while(!kbhit()); (this requires that you #include <conio.h>, BTW.) I've never written code to put a message in the message window, as I primarily code windows applications and, as such, simply use message boxes to output notifications, or put them in one of my windows. However, I do believe it's possible, when running under the IDE, to put messages into the message window. I'll try to figure out how, and let you know.
__________________
Paul M. Victorey ------------------ I am not responsible for any problems that may arise as a result of following my advice. This includes, but is not limited to, computer failure, loss of data, nuclear war, famine, boils, no clean laundry, your daughter running off with a biker gang, or armageddon. Take my advice at your own risk. Last edited by Paul Victorey; 07-30-2001 at 03:10 PM. |
|
|
|
|
|
#3 |
|
Member (9 bit)
Join Date: May 2000
Location: Asia-Singapore
Posts: 461
|
hi Paul Victorey, I was quite amazed, the output for borland C++ 5.02 behaves that way. mmmm....
Thanks ! moonlight burner |
|
|
|
|
|
#4 |
|
Member (12 bit)
Join Date: Mar 1999
Location: MN or WI
Posts: 3,017
|
You may have been used to a developing environment which provides its own console, especially if you've used Java. The reason things run as they do, however, is because the IDE tries to execute the program in similar conditions to how it will actually be used, if you executed it from DOS/Win. Because a DOS program is made to run in DOS, and accept console I/O that way, this is how Borland C++ executes it.
This is actually necessary, for cases in which you want to use more advanced DOS display commands. |
|
|
|
|
|
#5 |
|
Member (9 bit)
Join Date: May 2000
Location: Asia-Singapore
Posts: 461
|
I check it out. Thanks !
moonlight burner
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|