Board index » delphi » TPC causes DOS window to halt in NT 4.0

TPC causes DOS window to halt in NT 4.0

Here's a mystery for you.  The source files are laid out something
like this:

program Foobar;
  uses MyUnit1;
blah blah blah
end.

unit MyUnit1;
  uses MyUnit2, DOS;
blah blah blah
end.

unit MyUnit2;
  uses DOS;
blah blah blah
end.

It's an NT 4.0 machine with 128MB RAM; I run Turbo Pascal (for DOS)
7.0 in an ordinary CMD.EXE shell.  I've been working this way for
years and I've never seen this happen before, but today it happens
every stinkin' time.

I have maybe 10 or 12 procedures in MyUnit1, TPC compiles the units
and the application just fine.  Add just ONE MORE procedure to
MyUnit1, even an empty procedure (e.g., "procedure OneMore; begin;
end;" ) and now after TPC finishes the DOS window closes and I'm back
at the desktop.  It doesn't matter whether I declare the additional
procedure as an Interface procedure or not; it doesn't matter if the
application program just has the "uses MyUnit1; begin end." with no
actual commands in it.  It's like there is some limit that I'm going
beyond when I reach a certain number of procedure names in the
unit, and then TPC doesn't work any more.  I have tried changing
out all of the procedures in various combinations and it doesn't
matter which ones I use... with one exception.  If I remove the one
procedure which requires the MyUnit2 unit and take that out of the
"Uses" section, I can add all the procedures I want and the compile
works fine.

But wait, it gets weirder.  When I go back to DOS and look around, I
find that TPC worked fine and produced a perfectly happy EXE; it just
doesn't let me stay in DOS and admire my work.

I'm not done yet.  While I'm in the CMD shell, I open a second CMD
shell on top of that (so "EXIT" will return me to the first level
shell)... and now TPC works without a complaint.  I'm still in the
second CMD shell and have to EXIT back to the first CMD shell.

The whole problem went away as soon as I declared:
Uses MyUnit1, MyUnit2, DOS;
in the main application, even though it doesn't directly use
any procedures from MyUnit2 or DOS.

What in the blue blazes is going on here???  I tried various
combinations of compiler switches - linking to memory, linking to
disk, including debug objects, increasing stack size, nothing made
a difference.  Is there some limit to the depth of units invoking one
another?  Did I miss some documentation stating that we should
declare all units in the main application, even when those units
are only used by other units?

My brain hurts.

Peter B. Steiger
Cheyenne, WY
----
If you reply by email, send it to pbs at com dot
canada (or vice-versa).  All adverti{*word*224}ts will be
returned to your postmaster, eh!

 

Re:TPC causes DOS window to halt in NT 4.0


In article <3a9b3929.17714...@news.cheyne1.wy.home.com>,
  Peter B. Steiger wrote:

Quote

>It's an NT 4.0 machine with 128MB RAM; I run Turbo Pascal (for DOS)
>7.0 in an ordinary CMD.EXE shell.  I've been working this way for
>years and I've never seen this happen before, but today it happens
>every stinkin' time.

[snip details]

Quote
>But wait, it gets weirder.  When I go back to DOS and look around, I
>find that TPC worked fine and produced a perfectly happy EXE; it just
>doesn't let me stay in DOS and admire my work.

This sounds familiar.

Quote
>What in the blue blazes is going on here???  I tried various
>combinations of compiler switches - linking to memory, linking to
>disk, including debug objects, increasing stack size, nothing made
>a difference.  Is there some limit to the depth of units invoking one
>another?  Did I miss some documentation stating that we should
>declare all units in the main application, even when those units
>are only used by other units?

I don't know why it happens, but I had a similar problem with TP5.5
on NT 4.0.  I discovered that compiling certain units individually
would crash the DOS window (although, as you note, the compilation
finished) but that a corresponding TPC /B to compile all the units
would succeed, so I don't think it was a question of resources, nor
could I find any obvious property of the units to predict this.

For me, it started after applying a service pack (3, maybe?).  I
concluded that it was some awkwardness between TP and the NT DOS
virtual machine.  But it isn't happening now, with a newly loaded
workstation with only service pack 6 applied, so if you can reload
NT it _might_ help.

--
MJSR

Other Threads