Board index » delphi » Q: Console apps for NT using Delphi 1?

Q: Console apps for NT using Delphi 1?

Does anyone know if it is possible to write a console application for
Windows NT using Delphi 1?  I need to output to STDOUT for a CGI
application.  Any pointers or tips would be appreciated.  Thanks.

 

Re:Q: Console apps for NT using Delphi 1?


basically, place the {$apptype console} tag at the top of your project
source:

--- cut here --- console.dpr ---
        program console;

        {$apptype console}

        uses
          SysUtils;     // this is not necessary

        begin
          // add your code here...
          WriteLn( 'hello, world!' );
        end.
--- cut here --- console.dpr ---

if you compile the above file, you'll get a console mode program:

        dcc console.dpr

if you need step by step instructions on how to do this, try:

http://www.chamisplace.com/prog/tips/111596.html#programming

--
http://www.ChamisPlace.com/
Daily Tips (Internet, Windows, Programming, ...),

Gary Cramblitt <ga...@clark.net> wrote in article
<328d1ac8.450...@news.clark.net>...

Quote
> Does anyone know if it is possible to write a console application for
> Windows NT using Delphi 1?  I need to output to STDOUT for a CGI
> application.  Any pointers or tips would be appreciated.  Thanks.

Re:Q: Console apps for NT using Delphi 1?


Quote
"Chami" <72223...@compuserve.com> wrote:
>basically, place the {$apptype console} tag at the top of your project
>source:

Thanks for the comeback, but Delphi 1 does not support that compiler
directive. :-(

Re:Q: Console apps for NT using Delphi 1?


i somehow missed the "Delphi 1" part of your message! sorry about that...

anyway, i don't think you can create console mode programs using Delphi 1.x
:(

--
http://www.ChamisPlace.com/tips/
3 new Daily Tips (Internet, Windows, Programming/Delphi, ...) and more...

Gary Cramblitt <ga...@clark.net> wrote in article
<328f9023.378...@news.clark.net>...

Quote
> Thanks for the comeback, but Delphi 1 does not support that compiler
> directive. :-(

Re:Q: Console apps for NT using Delphi 1?


In article ,
    ga...@clark.net (Gary Cramblitt) wrote:

Quote

> Does anyone know if it is possible to write a console application for
> Windows NT using Delphi 1?  I need to output to STDOUT for a CGI
> application.  Any pointers or tips would be appreciated.  Thanks.

Now I have no Delphi 1.x installed to check this again but I once tried switch "/cd" and "/cp" using "dcc" as in:

dcc /cd myprog

and dcc answered with "Could not find TURBO.TPL or SYSTEM.TPU" or something similar. This suggests that in fact it could compile DOS or PROTECTED mode applications. Try getting a copy of TURBO.TPL and/or TURBO.TPP from a Borland Pascal 7.0 installation and make sure you add ";\delphi\source\rtl70" to your units path.

Please let me know through e-mail if you are successful.

Delphi 2.0 lets you develop "console applications"  using /cc as in:

dcc32 /cc myprog

or the corresponding linker option in the IDE. In these console applications input is STDIN and output is STDOUT. They require WIN32 to execute: they  work in MSDOS boxes but not in MSDOS compatibility mode.

Hope this has been helpful. Regards.

-----------------------------------------------------------------------
This article was posted to Usenet via the Posting Service at Deja News:
http://www.dejanews.com/           [Search, Post, and Read Usenet News]

Re:Q: Console apps for NT using Delphi 1?


ga>Thanks for the comeback, but Delphi 1 does not support that compiler
ga>directive. :-(

Delphi 1 does not support 'NT console apps' at all. What you can do is include
WinCRT in your USES statement and get a 16-bit simulated 'text mode' windows
app.

For real console apps (32-bit et al) you need Delphi 2.

--
Mr.Hillbilly (eiv...@infolink.no) http://www.sn.no/~eivind
 tHyperSoft HyperReader 1.0t

Re:Q: Console apps for NT using Delphi 1?


Quote
ga...@clark.net (Gary Cramblitt) wrote:
> Does anyone know if it is possible to write a console application for
> Windows NT using Delphi 1?  

Can't be done.  Console applications under NT must be 32-bit as well.
I'm not sure if CGI can run 16-bit extensions, but if it can, you could get
away with using good old Turbo Pascal ?

Lars F.

--
/Mr.Lars Fosdal    /Falcon AS   (a REUTERS company)   /Tel.+47 22005734
/lfos...@falcon.no /Stortorvet 10, N0155 OSLO, Norway /Fax.+47 22005777

Re:Q: Console apps for NT using Delphi 1?


Quote
On Mon, 18 Nov 1996, Eivind Bakkestuen wrote:
> Delphi 1 does not support 'NT console apps' at all. What you can do is include
> WinCRT in your USES statement and get a 16-bit simulated 'text mode' windows
> app.

> For real console apps (32-bit et al) you need Delphi 2.

I have some older TP 7.0 code that i'd like to convert to a Delphi console
app... Does Delphi have a unit which will emulate the old TP CRT unit?
Specifically screen I/O such as TextAttr, Window, GotoXY, etc?

Also, I have one program which uses the "fossil" driver for modem
communications... Anyone know how Delphi might handle this?

Thanks
James (new to Delphi)

Re:Q: Console apps for NT using Delphi 1?


James C <jco...@erols.com> wrote in article
<Pine.LNX.3.95.961124194502.18545B-100...@shell1.erols.com>...

Quote
> Also, I have one program which uses the "fossil" driver for modem
> communications... Anyone know how Delphi might handle this?

AsyncProfessional for Delhi from
http://www.tpower.com/
will help you.
Franc.Zi...@guest.arnes.si

Re:Q: Console apps for NT using Delphi 1?


Quote
James C (jco...@erols.com) wrote:

: I have some older TP 7.0 code that i'd like to convert to a Delphi console
: app... Does Delphi have a unit which will emulate the old TP CRT unit?
: Specifically screen I/O such as TextAttr, Window, GotoXY, etc?

If not, the Windows API certainly does.  The function names are not the
same but the functions are.  No graphics, but you can write text anywhere
on the screen and change the colors of the type.

: Also, I have one program which uses the "fossil" driver for modem
: communications... Anyone know how Delphi might handle this?

Again, I think the Windows API is your best bet.  Windows does the buffering
for you, making it much easier than under DOS.

--
Michael A. Covington                http://www.ai.uga.edu/faculty/covington/
Artificial Intelligence Center                                           <><
The University of Georgia               Unless otherwise indicated, I am not
Athens, GA 30602-7415 U.S.A.         speaking officially for the University.

Other Threads