Board index » delphi » Delphi and console apps

Delphi and console apps

Hi,

This may sound a little sick but I would like to write some console apps an
Delphi (V4), I don't seem to be able to find any much by way of the old BP7
crt unit. Does something similar exist either in Delphi that I have missed
or some third party source?

Also, is it possible to link in a library *.lib file in D4?

--
Cheers

Colin
colin.shortl...@jcu.edu.au

"Falling down is a mistake, not getting up is failure" Helen Keller

 

Re:Delphi and console apps


Quote
"Colin Shortland" <colic...@mydesk.net.au> wrote:
>This may sound a little sick but I would like to write some console apps an
>Delphi (V4), I don't seem to be able to find any much by way of the old BP7
>crt unit. Does something similar exist either in Delphi that I have missed
>or some third party source?

I don't know about D4, but on the D5 CD there is win32crt unit
which simulates the functions of the CRT in a text window.
Also, CRT_EFD (3rd party) replaces the CRT unit, but it uses
text mode.

Re:Delphi and console apps


Not sick at all

Here is say :

======  TEST.DPR  =======

program Greeting;

Uses SysUtils, Windows ;

{$APPTYPE CONSOLE}

var
  MyMessage: string;
  S : String ;
  I : Integer ;
  H : DWORD ;
  COORD : _COORD ;
begin
  I := 1 ;
  MyMessage := 'Hello world! - CLS or EXIT to Quit';
  While I <> 0 Do
    Begin
      Writeln(MyMessage + ' ' + IntToStr(I) );
      I := I + 1 ;
      Readln( S ) ;
      S := UpperCase( S ) ;
      If S = 'EXIT' Then
         I := 0 ;
      If S = 'CLS' Then
         Begin
         H := GetStdHandle( STD_OUTPUT_HANDLE ) ;
         COORD.X := 0 ;
         COORD.Y := 0 ;
         SetConsoleCursorPosition( H, COORD);
         S := StringOfChar( Chr(32), 2000 ) ;
         Writeln( S ) ;
         SetConsoleCursorPosition( H, COORD);
         End;
    End;
end.

On Sat, 30 Jun 2001 14:29:05 +1000, "Colin Shortland"

Quote
<colic...@mydesk.net.au> wrote:
>Hi,

>This may sound a little sick but I would like to write some console apps an
>Delphi (V4), I don't seem to be able to find any much by way of the old BP7
>crt unit. Does something similar exist either in Delphi that I have missed
>or some third party source?

>Also, is it possible to link in a library *.lib file in D4?

>--
>Cheers

>Colin
>colin.shortl...@jcu.edu.au

>"Falling down is a mistake, not getting up is failure" Helen Keller

Re:Delphi and console apps


If you are still unable to locate a Crt unit replacement, search
www.torry.net for Crt32.

"Colin Shortland" <colic...@mydesk.net.au> schreef in bericht
news:9hjlpl$k4n$1@gnamma.connect.com.au...

Quote
> Hi,

> This may sound a little sick but I would like to write some console apps
an
> Delphi (V4), I don't seem to be able to find any much by way of the old
BP7
> crt unit. Does something similar exist either in Delphi that I have missed
> or some third party source?

> Also, is it possible to link in a library *.lib file in D4?

> --
> Cheers

> Colin
> colin.shortl...@jcu.edu.au

> "Falling down is a mistake, not getting up is failure" Helen Keller

Re:Delphi and console apps


Quote
In article <9hk5ro$1gi...@scavenger.euro.net>, M.H. Avegaart wrote:
> If you are still unable to locate a Crt unit replacement, search
> www.torry.net for Crt32.

And of course the source code of Free Pascal contains such unit. Also for
Linux (Kylix)

Since the win32 version is based on win32 API, I don't expect problems when
compiling it with Delphi.

Other Threads