Board index » delphi » DOS programmer needs a clue.

DOS programmer needs a clue.

Since I've been dragged kicking and screaming into this windows
environment I now find I can't do a simple writeln unless I compile in
console mode.  Now I think console mode is interfering with some other
components I'm trying to use.

I want to open a "status window" and just post lines to it to act
exactly like a DOS writeln would.  Can somebody point me in the
direction of the proper component?

Dennis Powers
PC/POLL SYSTEMS
V 319-556-2323
F 319-556-0835
Den...@pcpoll.com

 

Re:DOS programmer needs a clue.


Dear Dennis,

for 1 line 'Status' displays, use a TLabel and update the caption property
as needed.
for multiline scrolling displays, a TMemo using 'Add' function. (will grow
like a text document, you may need to clear it out periodically)

I am an old Clipper head. I feel your pain :)

I wouldn't go back though!

fwiw
Charles Lam

Re:DOS programmer needs a clue.


Quote
Charles Lam wrote in message <01bcfe7d$80d8f300$c3ca928b@charles>...
>I am an old Clipper head. I feel your pain :)

>I wouldn't go back though!

>fwiw
>Charles Lam

they teach us turbo c++ (dos) in college !!!

Re:DOS programmer needs a clue.


Dear Dennis,

Ther are several way to organize "console" in normal Windows application.
One of them is:

1. Put a TListbox object on the form.

2. Create procedure named like WriteLineToConsole getting one string
argument and adding
that string to the bottom of listbox. Just check sometime for number of
line contained ain listbox.
It has good capacity under Win95, but it's not a good idea to keep 5000
lines in single listbox.

3. Listbox brings you small overhead and provides an ability to scroll up
and down so you
can see more than "good old 25 lines".

The procedure may look like

procedure TMyForm.WriteLineToConsole( const sMsg :string );
begin
  { Check log size and remove strings if need. Set MAX_CONS_LINES to 128
for example }
  while (LboxConsole.Items.Count > MAX_CONS_LINES ) do begin
    LboxConsole.Items.Delete(0)
  end;

  { Add message, and make it selected and visible }
  LboxConsole.Items.Add( sMsg );
  LboxConsole.ItemIndex := Log.Items.Count - 1;
end;

This way is faster and convenien than using memo control.

Dennis Powers <Den...@pcpoll.com> ???? a ?t
<3482eaf7.61928...@forums.borland.com>...

Quote
> I want to open a "status window" and just post lines to it to act
> exactly like a DOS writeln would.  Can somebody point me in the
> direction of the proper component?

Re:DOS programmer needs a clue.


Quote

> I want to open a "status window" and just post lines to it to act
> exactly like a DOS writeln would.  Can somebody point me in the
> direction of the proper component?

> Dennis Powers
> PC/POLL SYSTEMS
> V 319-556-2323
> F 319-556-0835
> Den...@pcpoll.com

Dennis,

If you ever need to print directly onto a form to simulate the look of a
console app,

you can print directly onto the canvas of the form:

Form1.Canvas.Textout(across,Down,'Gday Dennis');

Happy Coding!<g>.

I am familiar with PC POLL.....Keep up the good work. I also agree with the
other replies to this thread; Once you accustom yourself to the IDE you
will never look back. There are Great books available to help you through
the initial shift in emphasis from DOS to Windows.

Delphi Developers Guide    SAMS Publishing     Author: Xavier Pacheco

Mastering Delphi           SYBEX                 Author: Marco Cantu

Regards,

John Trenton
Synchrosoft.

Re:DOS programmer needs a clue.


Quote
> Since I've been dragged kicking and screaming into this windows
> environment I now find I can't do a simple writeln unless I compile in
> console mode.  Now I think console mode is interfering with some other
> components I'm trying to use.

> I want to open a "status window" and just post lines to it to act
> exactly like a DOS writeln would.  Can somebody point me in the
> direction of the proper component?

Dennis,

I made a component which looks like a TMemo but accept you write strings
with embedded ansi escape sequences to position the cursor, change
attribute, erase, and write. This component act as an ansi terminal
(VT100).

It's a freeware available at http://www.rtfm.be/fpiette/indexuk.htm It's
part of an Internet Component Suite where is is used to build a telnet
client program. But the component can be used standalone.

--

francois.pie...@ping.be

Re:DOS programmer needs a clue.


Quote
Dennis Powers wrote:
> Since I've been dragged kicking and screaming into this windows
> environment I now find I can't do a simple writeln unless I compile in
> console mode.  Now I think console mode is interfering with some other
> components I'm trying to use.

> I want to open a "status window" and just post lines to it to act
> exactly like a DOS writeln would.  Can somebody point me in the
> direction of the proper component?

Using Delphi 2/3, just call AllocConsole when the app is starting, and you can use Write/WriteLn as
ususal.

Know how you feel...

Regards,

Erik.

--
Development of applications and drivers for Windows 95 and NT.
Go visit http://www.POBoxes.com/Sperling for some free source!
Check out Delphi Bug Lists at http://www.POBoxes.com/DelphiBugList
PGP public key available at http://www.POBoxes.com/Sperling/pgpkey.txt

Erik Sperling Johansen, Sperl...@POBoxes.com (DeBug Team; checker, monitor)

Other Threads