Solved

_ Console EXE

Posted on 1998-12-22
9
241 Views
Last Modified: 2011-09-20
Hi everybody.

Is it possible to make a 100% DOS console application with Delphi 3 standard version?

I've made some console exe with delphi std but they require win32 mode.

Tell me how to do it.

Wein
0
Comment
Question by:Wein
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 3

Accepted Solution

by:
williams2 earned 50 total points
ID: 1352500
Yes, it is possible, but you need to do this:

Go to mainemenu project->Options..->Linker and press generate console application.

Then you will have to remove unit1 and go to the project source and remove the uses clause and the application object too.

Now you should only have this left in project1.dpr:

program Project1;

begin
  WriteLn('Hello!');
  ReadLn;
end.


And you are ready to go!

basically you should have a single unit without a form, and then call the main procedure from the project source where I did some 'Hello' thing instead.
0
 
LVL 3

Expert Comment

by:williams2
ID: 1352501
..by the way:

When doing procedures from inside another unit, you should do like this:

program Project1;

uses Unit2 in 'Unit2.pas';

begin
  Main;
end.

.having:

unit Unit2;

interface

  Procedure Main;

implementation

  procedure main;
  Begin
    WriteLn('Hello!');
    ReadLn;
  End;

end.

Regards,
Williams

0
 

Author Comment

by:Wein
ID: 1352502
This will run in the DOS mode?

I mean, not the DOS prompt of windows, right?

I'll try it. I'll give you the points soon if it works.

Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:williams2
ID: 1352503
I certainly hope so :-)
0
 

Author Comment

by:Wein
ID: 1352504
It gives an error that the uses clause is missing.
0
 
LVL 3

Expert Comment

by:williams2
ID: 1352505
Yes, just put a dummy inside the uses clause. Try to add a dummy unit like a Unit1.pas without anything inside.

The the program should look like this:

program Project1;

uses
  Unit1 in 'Unit1.pas';

begin
  WriteLn('Hello!');
  ReadLn;
end.

and the unit:

unit Unit1;

interface

implementation

end.



And you'll be ready to roll! :-)

Regards,
Williams
0
 

Author Comment

by:Wein
ID: 1352506
It works but it can't be run in DOS mode.
0
 
LVL 3

Expert Comment

by:williams2
ID: 1352507
That's maybe because the compiler is set to 32bit mode, you can compile a delphi project with the dcc.exe compiler.

I do not use it often, so you may try it out yourself, but I'm sure that it can be done this way.

Regards,
Williams
0
 

Author Comment

by:Wein
ID: 1352508
Well, thanx for taking care about my question for such a long time.

I'll try it, even if it still won't work, i'll give you the points.

Thanx. Happy New Year.

WEiN
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question