_ Console EXE

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
WeinAsked:
Who is Participating?
 
williams2Commented:
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
 
williams2Commented:
..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
 
WeinAuthor Commented:
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
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
williams2Commented:
I certainly hope so :-)
0
 
WeinAuthor Commented:
It gives an error that the uses clause is missing.
0
 
williams2Commented:
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
 
WeinAuthor Commented:
It works but it can't be run in DOS mode.
0
 
williams2Commented:
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
 
WeinAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.