Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

_ Console EXE

Posted on 1998-12-22
9
Medium Priority
?
242 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 200 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
Independent Software Vendors: 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

971 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