[comp.lang.pascal] ansi question for turbo 5.0+

tpehrson@javelin.es.com (Tim Clinkenpeel) (03/21/91)

hey.  it's me again.

does turbo 5.0 and or versions higher support ansi cursor controls (beside
the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
(cursor right) and clear line.

ANY help is GREATLY appreciated (as always)
-- 
one two! one two! & through & through /=============================/ hear your
the vorpal blade went snicker-snack! / tpehrson@javelin.sim.es.com / death boon 
he left it dead, and with his head  /=====aka: tim clinkenpeel====/ the wail of
he went galumphing back [DISCLAIMER: send SASE to: disclaimer, 84151-0521] DOOM 

tpehrson@javelin.es.com (Tim Clinkenpeel) (03/21/91)

tpehrson@javelin.es.com (Tim Clinkenpeel) writes:
>does turbo 5.0 and or versions higher support ansi cursor controls (beside
>the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
>(cursor right) and clear line.

addendum:  i discovered clreol, still searching for ~[#c equiv.
-- 
one two! one two! & through & through /=============================/ hear your
the vorpal blade went snicker-snack! / tpehrson@javelin.sim.es.com / death boon 
he left it dead, and with his head  /=====aka: tim clinkenpeel====/ the wail of
he went galumphing back [DISCLAIMER: send SASE to: disclaimer, 84151-0521] DOOM 

sjs@gnv.ifas.ufl.edu (03/21/91)

In article <1991Mar20.161211.28435@javelin.es.com>, tpehrson@javelin.es.com
(Tim Clinkenpeel) writes:
> does turbo 5.0 and or versions higher support ansi cursor controls (beside
> the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
> (cursor right) and clear line.

I do this sort of stuff in MS Pascal.  You need an ANSI driver loaded on
the PC, like ANSI.SYS.  Then just do WRITEs to the screen, writing whatever
escape sequences you want:

        const
          ESC = chr(27);


        write (ESC,'[',right_steps:1,'C');     { Cursor right. }
        write (ESC,'[',row:1,';',col:1,'f');   { Set cursor position. }



 +---------------------------------------------+------------------------------+
 |     ~~~     Sid Sachs                       | "Time to wake up!            |
 |   / \ ~~~   at the Mountains of Madness     |    Time to rise!"            |
 |  /  / \                                     |                              |
 | /  /   \    Bitnet:    sjs@ifasgnv          | - Silver Lady,               |
 |   /     \   Internet:  sjs@gnv.ifas.ufl.edu |   Intergalactic Touring Band |
 +---------------------------------------------+------------------------------+

ts@uwasa.fi (Timo Salmi) (03/21/91)

In article <1991Mar20.161211.28435@javelin.es.com> tpehrson@javelin.sim.es.com writes:
>hey.  it's me again.

Ditto :-).

>does turbo 5.0 and or versions higher support ansi cursor controls (beside
>the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
>(cursor right) and clear line.

Your query is a slight misunderstanding of the issue, because this
is not really a question of Turbo Pascal actively supporting or not
supporting something.  If you write ansi cursor controls characters
with the write command, ansi.sys will function in its normal way. 
(Unless you have instructed direct screen writes by including: Uses
Crt). 

...................................................................
Prof. Timo Salmi        
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

ballerup@diku.dk (Per Goetterup) (03/22/91)

ts@uwasa.fi (Timo Salmi) writes:

=>In article <1991Mar20.161211.28435@javelin.es.com> tpehrson@javelin.sim.es.com writes:
=>>hey.  it's me again.

=>Ditto :-).

=>>does turbo 5.0 and or versions higher support ansi cursor controls (beside
=>>the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
=>>(cursor right) and clear line.

=>Your query is a slight misunderstanding of the issue, because this
=>is not really a question of Turbo Pascal actively supporting or not
=>supporting something.  If you write ansi cursor controls characters
=>with the write command, ansi.sys will function in its normal way. 
=>(Unless you have instructed direct screen writes by including: Uses
=>Crt). 

If you need the Crt unit for other purposes, just add 'System.' to all
write and writeln that has to do with the ANSI-codes, like this:

System.Write( ... );

This instructs the compiler to use write from the System unit instead
of the write in the Crt unit which will replace it when 'used'.

This should work in TP4, TP5, TP55 and TP6.

=>...................................................................
=>Prof. Timo Salmi        
=>Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
=>School of Business Studies, University of Vaasa, SF-65101, Finland
=>Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

-- 
| Per Gotterup                        | "The most merciful thing in the    |
| Student, DIKU (Dept. of Comp. Sci.) | world, I think, is the inability   |
| University of Copenhagen, Denmark   | of the human mind to correlate all |
| Internet: ballerup@freja.diku.dk    | its contents."  - H.P. Lovecraft - |

terra@diku.dk (Morten Welinder) (03/22/91)

ballerup@diku.dk (Per Goetterup) writes:

>ts@uwasa.fi (Timo Salmi) writes:

>=>In article <1991Mar20.161211.28435@javelin.es.com> tpehrson@javelin.sim.es.com writes:
>=>>hey.  it's me again.

>=>Ditto :-).

>=>>does turbo 5.0 and or versions higher support ansi cursor controls (beside
>=>>the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
>=>>(cursor right) and clear line.

>=>Your query is a slight misunderstanding of the issue, because this
>=>is not really a question of Turbo Pascal actively supporting or not
>=>supporting something.  If you write ansi cursor controls characters
>=>with the write command, ansi.sys will function in its normal way. 
>=>(Unless you have instructed direct screen writes by including: Uses
>=>Crt). 

>If you need the Crt unit for other purposes, just add 'System.' to all
>write and writeln that has to do with the ANSI-codes, like this:

>System.Write( ... );

>This instructs the compiler to use write from the System unit instead
>of the write in the Crt unit which will replace it when 'used'.

>This should work in TP4, TP5, TP55 and TP6.

WARNING: Don't believe it! To access standard output (ie. go through dos)
         when using crt, open a file with file name ''. eg: 
               assign(output,''); rewrite(output);

Morten Welinder
terra@rimfaxe.diku.dk

ts@uwasa.fi (Timo Salmi) (03/23/91)

In article <1991Mar22.132957.893@odin.diku.dk> ballerup@diku.dk (Per Goetterup) writes:
:
>If you need the Crt unit for other purposes, just add 'System.' to all
>write and writeln that has to do with the ANSI-codes, like this:
>
>System.Write( ... );
>
>This instructs the compiler to use write from the System unit instead
>of the write in the Crt unit which will replace it when 'used'.
>
>This should work in TP4, TP5, TP55 and TP6.

That's _not_ correct.  If you had cared to test your assertion you
would have seen that this is so.  - Never mind, though.  These
things happen so all the time.  (To me, at least :-). 

...................................................................
Prof. Timo Salmi        
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

bobb@vice.ICO.TEK.COM (Bob Beauchaine) (03/23/91)

In article <1991Mar21.102223.8284@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes:
>
>Your query is a slight misunderstanding of the issue, because this
>is not really a question of Turbo Pascal actively supporting or not
>supporting something.  If you write ansi cursor controls characters
>with the write command, ansi.sys will function in its normal way. 
>(Unless you have instructed direct screen writes by including: Uses
>Crt). 
>

 But don't fear using the CRT unit and maintaining ANSI control, since
 you can set the DirectVideo variable (found in the CRT unit). Of 
 course, you'll pay the penalty in speed, but isn't that what ANSI.SYS
 is all about?  

 BTW, I recommend PC Magazine's Ansi.com, a .COM file replacement for
 ANSI.SYS with more features and faster to boot.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 

Bob Beauchaine bobb@vice.ICO.TEK.COM 

C: The language that combines the power of assembly language with the 
   flexibility of assembly language.

ts@uwasa.fi (Timo Salmi) (03/24/91)

In article <7153@vice.ICO.TEK.COM> bobb@vice.ICO.TEK.COM (Bob Beauchaine) writes:
:
> But don't fear using the CRT unit and maintaining ANSI control, since
> you can set the DirectVideo variable (found in the CRT unit). Of 
:

   How come this particular issue produces so many suggestions that
won't work.  No problem, nor a big deal, though.  Just interesting. 
As I said, I make these mistakes all the time myself.  (Even now?)
   No, you either have to leave uses Crt out, or apply assign
(output, ''); rewrite (output);
   But try out the alternatives with the TP compiler and a piece of
code, and judge yourself what will work and what won't. 

...................................................................
Prof. Timo Salmi        
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

dave@tygra.UUCP (David Conrad) (03/24/91)

In article <1991Mar20.162619.28743@javelin.es.com> tpehrson@javelin.sim.es.com writes:
>tpehrson@javelin.es.com (Tim Clinkenpeel) writes:
>>does turbo 5.0 and or versions higher support ansi cursor controls (beside
>>the insanely rigid gotoxy)?  i _need_ to do the ansi equivelent of ~[xC
>>(cursor right) and clear line.
>
>addendum:  i discovered clreol, still searching for ~[#c equiv.

Hey!  Thanks for posting before you RTFM!!!
 
When I read your question about `cursor right' I thought, "He can't possibly
want `gotoxy(wherex+1,wherey);', no, no one could be that stupid."  But now
it appears that I was wrong.  I bet you'll respond with a question about how
to get it to wrap to the next line if it's in the right column.

setFlame(False);

David Conrad
sharkey!tygra!dave
-- 
=  CAT-TALK Conferencing Network, Computer Conferencing and File Archive  =
-  1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new'    - 
=  as a login id.  AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET")        =
   E-MAIL Address: dave@DDMI.COM

ballerup@diku.dk (Per Goetterup) (03/25/91)

Ups! - What a goof from me! - Not testing before I post - SHAME ON ME!

ts@uwasa.fi (Timo Salmi) writes:

[ stuff deleted ]

=>   How come this particular issue produces so many suggestions that
=>won't work.  No problem, nor a big deal, though.  Just interesting. 
=>As I said, I make these mistakes all the time myself.  (Even now?)
=>   No, you either have to leave uses Crt out, or apply assign
=>(output, ''); rewrite (output);

There is another alternative, but a bit more complex. You could also write
your own write/writeln (in TP or assembler as you please) that uses the
MSDOS interrupt (21h) to do its work.

I DID THIS MYSELF AND I'VE TESTED IT AND IT WORKS! (also with ANSI)

=>   But try out the alternatives with the TP compiler and a piece of
=>code, and judge yourself what will work and what won't. 

VERY good idea!

=>...................................................................
=>Prof. Timo Salmi        
=>Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.12.37
=>School of Business Studies, University of Vaasa, SF-65101, Finland
=>Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

	Sorry for the goof...

		Per.

-- 
| Per Gotterup                        | "The most merciful thing in the    |
| Student, DIKU (Dept. of Comp. Sci.) | world, I think, is the inability   |
| University of Copenhagen, Denmark   | of the human mind to correlate all |
| Internet: ballerup@freja.diku.dk    | its contents."  - H.P. Lovecraft - |

rog@hpdtczb.HP.COM (Roger Haaheim) (03/26/91)

=->  / hpdtczb:comp.lang.pascal / dave@tygra.UUCP (David Conrad) /  1:22 am  Mar 24, 1991 /

=->  When I read your question about `cursor right' I thought, "He can't possibly
=->  want `gotoxy(wherex+1,wherey);', no, no one could be that stupid."  But now
=->  it appears that I was wrong.  I bet you'll respond with a question about how
=->  to get it to wrap to the next line if it's in the right column.
=->  
=->  ----------

This unnecessary response seems to speak volumes about your self-image