Solved

_ Console EXE

Posted on 1998-12-22
9
240 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
  • 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now