Board index » delphi » Console app problems

Console app problems

I am creating a console mode application that just keeps quitting for
seemingly no apparent reason, I've trace the program when it reaches a
certain line the program ends.

Andrew

 

Re:Console app problems


"Andrew" <a...@freesoftREMOVETHIS.fsnet.co.uk> skrev i melding
news:adsjau$8ki$1@newsg2.svr.pol.co.uk...

Quote
> I am creating a console mode application that just keeps quitting for
> seemingly no apparent reason, I've trace the program when it reaches a
> certain line the program ends.

You should definately post a few lines showing what causes your application
to terminate...

--
Bj?rge S?ther
bjorge@hahaha_itte.no

Re:Console app problems


On Sat, 8 Jun 2002 10:41:33 +0100, "Andrew"

Quote
<a...@freesoftREMOVETHIS.fsnet.co.uk> wrote:
>I am creating a console mode application that just keeps quitting for
>seemingly no apparent reason, I've trace the program when it reaches a
>certain line the program ends.

Console applications don't usually have the same default interrupt
handler as windowed applications.  You might be triggering an
interrupt, and terminating when it isn't handled.

Duncan Murdoch

Re:Console app problems


On Sat, 8 Jun 2002 10:41:33 +0100, "Andrew"

Quote
<a...@freesoftREMOVETHIS.fsnet.co.uk> wrote:
>I am creating a console mode application that just keeps quitting for
>seemingly no apparent reason, I've trace the program when it reaches a
>certain line the program ends.

That happens from time to time with me too.  It usually helps to run
it from the EXE instead of the IDE, you get an error message that way.

Re:Console app problems


On Sat, 08 Jun 2002 11:17:54 GMT, "Bj?rge S?ther"

Quote
<bjorge@hahaha_itte.no> wrote:
>You should definately post a few lines showing what causes your application
>to terminate...

The problem is that a lot of time with console apps running in the
IDE, they abort with no error message.

Re:Console app problems


Quote
> The problem is that a lot of time with console apps running in the
> IDE, they abort with no error message.

I suppose I really want around a way round this rather than you fixing my
bad code - debugging is half the fun anyway :-).

Re:Console app problems


Quote
"Duncan Murdoch" <dmurd...@pair.com> wrote in message

news:n424gukrrqc3t9gg85elfju972ohi7tg09@4ax.com...

Quote
> Console applications don't usually have the same default interrupt
> handler as windowed applications.  You might be triggering an
> interrupt, and terminating when it isn't handled.

> Duncan Murdoch

Funny thing, if you raise an exception from the app itself, an exception
shows but otherwise it won't.

Re:Console app problems


On Sat, 8 Jun 2002 19:15:25 +0100, "Andrew"

Quote
<a...@freesoftREMOVETHIS.fsnet.co.uk> wrote:
>I suppose I really want around a way round this rather than you fixing my
>bad code - debugging is half the fun anyway :-).

Well, the error code from the EXE should help.  Also, with problems
like this in console mode, I've had to resort to old fashoned
debugging - put several ShowMessage( 'point 1') etc in there (yes you
can do that in console mode if you add Windows to the uses statement).
Then you can narrow down where it is going wrong.

Re:Console app problems


On Sat, 8 Jun 2002 19:16:45 +0100, "Andrew"

Quote
<a...@freesoftREMOVETHIS.fsnet.co.uk> wrote:
>Funny thing, if you raise an exception from the app itself, an exception
>shows but otherwise it won't.

I think that is a bug in console mode in the IDE. (no flames please)

Re:Console app problems


On Sat, 8 Jun 2002 10:41:33 +0100, "Andrew"

Quote
<a...@freesoftREMOVETHIS.fsnet.co.uk> wrote:
> I am creating a console mode application that just keeps quitting for
> seemingly no apparent reason, I've trace the program when it reaches a
> certain line the program ends.

That normally points to an exception of access violation happening.
Try to run it from outsdie the IDE, and see what happens then. The
console will *not* disappear there.

Re:Console app problems


On Sat, 08 Jun 2002 14:29:43 -0400, Jan Philips

Quote
<jud.mccra...@mindspring.com> wrote:
> Well, the error code from the EXE should help.  Also, with problems
> like this in console mode, I've had to resort to old fashoned
> debugging - put several ShowMessage( 'point 1') etc in there (yes you
> can do that in console mode if you add Windows to the uses statement).
> Then you can narrow down where it is going wrong.

Not Windows but Dialogs, IIRC. I often do the same when debugging a
console mode program. Also, running it from a console (i.e. not in the
IDE) can give a clue on what actually happens.

Re:Console app problems


On Sat, 08 Jun 2002 21:40:27 +0200, Rudy Velthuis <rvelth...@gmx.de>
wrote:

Quote
>Not Windows but Dialogs, IIRC.

You're right - dialogs for ShowMessage (and MsgDialog).

Re:Console app problems


Thanks everyone for your suggestions. I've managed to get the de{*word*81} to
work properly. Put everything inside an try...except block, the exception is
raised, like normal. It goes to the offending line. I solved my problem, a
daft off by one.

Other Threads