BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Off Topic DOS question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical)
View previous topic :: View next topic  
Author Message
LarryJ
Guest





PostPosted: Sun Feb 05, 2006 9:00 pm    Post subject: Off Topic DOS question Reply with quote



I have an old DOS program that calculates the position of a planet for a
given date. When I run the program on a computer with a modern OS such as
WindowsXP Home the program makes all the calculations and then automatically
exits so I can never see the results. Does anyone know how I can make the
program pause before exiting?

Thanks
Larry Johnson.
Back to top
Anders Ohlsson (Borland)
Guest





PostPosted: Sun Feb 05, 2006 9:00 pm    Post subject: Re: Off Topic DOS question Reply with quote



Quote:
I have an old DOS program that calculates the position of a planet for a
given date. When I run the program on a computer with a modern OS such as
WindowsXP Home the program makes all the calculations and then automatically
exits so I can never see the results. Does anyone know how I can make the
program pause before exiting?


Just run it from the command line, instead of double clicking on it.

--
Anders Ohlsson - http://blogs.borland.com/ao/
http://homepages.borland.com/aohlsson/blog_beta/#disclaimer
Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Sun Feb 05, 2006 9:00 pm    Post subject: Re: Off Topic DOS question Reply with quote



At 21:27:25, 05.02.2006, Duane Hebert wrote:

Quote:
Just run it from the command line, instead of double clicking on it.

Or put a getch() (from conio.h) in the last line of the main()
function.

Or put system("pause").

Hmmm...

FWIW, and more a reply to Anders' message: there are a few utilities I
love. One of them is "Open Command Line Here" from the Microsoft
PowerToys for XP. It appears in the context menu of every directory, and
opens a command line with that directory as the current one.

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

--
Rudy Velthuis [TeamB] http://rvelthuis.de/

"I find that the harder I work, the more luck I seem to have."
- Thomas Jefferson (1743-1826)
Back to top
Duane Hebert
Guest





PostPosted: Sun Feb 05, 2006 9:00 pm    Post subject: Re: Off Topic DOS question Reply with quote

"Rudy Velthuis [TeamB]" <velthuis (AT) gmail (DOT) com> wrote in message
news:xn0ei4qrtm44rsq01b-velthuis (AT) www (DOT) teamb.com...
Quote:
At 21:14:24, 05.02.2006, Anders Ohlsson (Borland) wrote:


I have an old DOS program that calculates the position of a planet
for a given date. When I run the program on a computer with a modern
OS such as WindowsXP Home the program makes all the calculations and
then automatically exits so I can never see the results. Does anyone
know how I can make the program pause before exiting?

Just run it from the command line, instead of double clicking on it.

Or put a getch() (from conio.h) in the last line of the main() function.

Or put system("pause").
Back to top
Rudy Velthuis [TeamB]
Guest





PostPosted: Sun Feb 05, 2006 9:00 pm    Post subject: Re: Off Topic DOS question Reply with quote

At 21:14:24, 05.02.2006, Anders Ohlsson (Borland) wrote:

Quote:

I have an old DOS program that calculates the position of a planet
for a given date. When I run the program on a computer with a modern
OS such as WindowsXP Home the program makes all the calculations and
then automatically exits so I can never see the results. Does anyone
know how I can make the program pause before exiting?

Just run it from the command line, instead of double clicking on it.

Or put a getch() (from conio.h) in the last line of the main() function.

--
Rudy Velthuis [TeamB] http://rvelthuis.de/

"Testing proves the presence, not the absence, of bugs."
-- Edsger Dijkstra
Back to top
Ed Mulroy
Guest





PostPosted: Sun Feb 05, 2006 11:01 pm    Post subject: Re: Off Topic DOS question Reply with quote

------------------------
int main(...
...
printf("Press Enter ..."); /* Added */
getchar(); /* Added */
return 0;
}
------------------------

.. Ed

Quote:
LarryJ wrote in message
news:43e65b2d$1 (AT) newsgroups (DOT) borland.com...

I have an old DOS program that calculates the position of a planet for a
given date. When I run the program on a computer with a modern OS such as
WindowsXP Home the program makes all the calculations and then
automatically exits so I can never see the results. Does anyone know how I
can make the program pause before exiting?
Back to top
Alisdair Meredith[TeamB]
Guest





PostPosted: Sun Feb 05, 2006 11:01 pm    Post subject: Re: Off Topic DOS question Reply with quote

LarryJ wrote:

Quote:
I have an old DOS program that calculates the position of a planet
for a given date. When I run the program on a computer with a modern
OS such as WindowsXP Home the program makes all the calculations and
then automatically exits so I can never see the results. Does anyone
know how I can make the program pause before exiting?

I see the problem all the time when running test cases - console apps
just don't hang around!

The traditional answer is to add some code to demand a user input
before quitting.

Personally, I just put a break-point on the closing brace of main() and
run through the debugger.

CBuilderX used to display the output from console apps in the Message
window of the IDE, and it would be a REALLY nice feature to have in
BDS...

--
AlisdairM(TeamB)
Back to top
roman modic
Guest





PostPosted: Mon Feb 06, 2006 12:01 am    Post subject: Re: Off Topic DOS question Reply with quote

Hello!

"LarryJ" <LarryJ33 (AT) ev1 (DOT) net> wrote in message news:43e65b2d$1 (AT) newsgroups (DOT) borland.com...
Quote:
I have an old DOS program that calculates the position of a planet for a given date. When I run the program on a computer with a
modern OS such as WindowsXP Home the program makes all the calculations and then automatically exits so I can never see the
results. Does anyone know how I can make the program pause before exiting?

Right-click on program icon, select "Properties", click on tab named "Program"
and remove the tick from "Close on exit"

Servus, Roman
Back to top
David Dean
Guest





PostPosted: Mon Feb 06, 2006 2:01 am    Post subject: Re: Off Topic DOS question Reply with quote

In article <43e67718$1 (AT) newsgroups (DOT) borland.com>,
"Alisdair Meredith[TeamB]"
<alisdair.meredith@no-spam-splease (AT) uk (DOT) renaultf1.com> wrote:

Quote:
CBuilderX used to display the output from console apps in the Message
window of the IDE, and it would be a REALLY nice feature to have in
BDS...

Is this in QC? If it is, I'll move at least one vote to it.

--
-David

Nihil curo de ista tua stulta superstitione.
Back to top
Michael Gillen
Guest





PostPosted: Mon Feb 06, 2006 3:01 pm    Post subject: Re: Off Topic DOS question Reply with quote

roman modic wrote:

Quote:
Hello!

"LarryJ" <LarryJ33 (AT) ev1 (DOT) net> wrote in message news:43e65b2d$1 (AT) newsgroups (DOT) borland.com...
I have an old DOS program that calculates the position of a planet for a given date. When I run
the program on a computer with a modern OS such as WindowsXP Home the program makes all the
calculations and then automatically exits so I can never see the results. Does anyone know how
I can make the program pause before exiting?

Right-click on program icon, select "Properties", click on tab named "Program"
and remove the tick from "Close on exit"

Servus, Roman

Or call it from a batch file and put "pause" as the final command.

--
-Michael Gillen
Back to top
Tim Del Chiaro (Borland)
Guest





PostPosted: Mon Feb 06, 2006 8:01 pm    Post subject: Re: Off Topic DOS question Reply with quote

Very nice. Thanks for the tip.

Tim

"Rudy Velthuis [TeamB]" <velthuis (AT) gmail (DOT) com> wrote in message
news:xn0ei4rbqm4xmwq01c-velthuis (AT) www (DOT) teamb.com...


Quote:
FWIW, and more a reply to Anders' message: there are a few utilities I
love. One of them is "Open Command Line Here" from the Microsoft
PowerToys for XP. It appears in the context menu of every directory, and
opens a command line with that directory as the current one.

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx
Back to top
Alisdair Meredith[TeamB]
Guest





PostPosted: Wed Feb 08, 2006 2:01 am    Post subject: Re: Off Topic DOS question Reply with quote

David Dean wrote:

Quote:
Is this in QC? If it is, I'll move at least one vote to it.

QC24623, it is there now ;?)
I'm storing my own votes up for compiler fixes though - useful as this
would be.

--
AlisdairM(TeamB)
Back to top
David Dean
Guest





PostPosted: Wed Feb 08, 2006 6:02 pm    Post subject: Re: Off Topic DOS question Reply with quote

In article <43e9403d$1 (AT) newsgroups (DOT) borland.com>,
"Alisdair Meredith[TeamB]"
<alisdair.meredith@no-spam-splease (AT) uk (DOT) renaultf1.com> wrote:

Quote:
QC24623, it is there now ;?)
I'm storing my own votes up for compiler fixes though - useful as this
would be.

I have one vote that is for feature requests, one vote for a boost
fix, one for fixing the C++/VCL exception handling, one for the
debugger, and one for .hpp file generation. There just are too many
areas to split my votes between.

--
-David

Nihil curo de ista tua stulta superstitione.
Back to top
Mark Jacobs
Guest





PostPosted: Tue Feb 14, 2006 2:03 pm    Post subject: Re: Off Topic DOS question Reply with quote

LarryJ wrote:
Quote:
I have an old DOS program that calculates the position of a planet for a
given date. When I run the program on a computer with a modern OS such as
WindowsXP Home the program makes all the calculations and then automatically
exits so I can never see the results. Does anyone know how I can make the
program pause before exiting?

Perhaps this was a joke post. The OP has not replied to any of the suggestions. Larry,
have you been hospitalised? Is your mum ill? Please reply.
--
Mark Jacobs
http://www.dkcomputing.co.uk
Back to top
roman modic
Guest





PostPosted: Tue Feb 14, 2006 3:03 pm    Post subject: Re: Off Topic DOS question Reply with quote

Hello!

"Mark Jacobs" <markj (AT) critical (DOT) co.uk> wrote in message news:43f1dc32$1 (AT) newsgroups (DOT) borland.com...
Quote:
LarryJ wrote:
I have an old DOS program that calculates the position of a planet for a given date. When I run the program on a computer with a
modern OS such as WindowsXP Home the program makes all the calculations and then automatically exits so I can never see the
results. Does anyone know how I can make the program pause before exiting?

Perhaps this was a joke post. The OP has not replied to any of the suggestions. Larry, have you been hospitalised? Is your mum
ill? Please reply.

Probably not. Maybe he is not a frequent visitor of this group:
http://groups.google.com/groups/profile?enc_user=PXBBDRAAAAC6Ep_PJGXxMZDogEO8U4xX

Roman
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical) All times are GMT
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, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.