[comp.lang.pascal] Reading Graphics in TP Pascal

jbb@mvaxcs1.cse.nau.edu (Jon Bonnell) (06/18/91)

In article <1991Jun14.150309.5126@cunixf.cc.columbia.edu> stone@cunixb.cc.columbia.edu (Glenn Stone) writes:
>There must an easy way to do this but I seem to have a mental block.  
>I'm writing a graphics mode equivalent of READLN(StringVariable) in
>TP 5.5.  This loop reads characters and tacks them onto a string
>called T.  The problem is in dealing with the backspace; I want the
>pointer to back up and erase the last character, but the ' ' in
>graphics mode doesn't do this.  I need the equivalent of ClrEol.
>How do you do it?  Thanks in advance...
>  Glenn Stone                                      BITNET: stone@cunixc
>  Columbia University            INTERNET: stone@cunixb.cc.columbia.edu
>-------------------------------------------------------------------------


Try the Unit CRTG.ZIP on Garbo.  It redefines the CRT Unit of
Turbo Pascal in Graphics Mode (combination of CRT and GRAPH).
 
I dont know if it will fix this exact problem but you might want to
take a look instead of reinventing another solution.


-- 
Jon Bonnell                "Like I always say --
jbb@mvaxcs1.cse.nau.edu       Why Jack off when you can jack in?"

Disclaimer :NAU has no opinion and I have mine...

dre@sequoia.cray.com (Dennis Ellis) (06/19/91)

>>called T.  The problem is in dealing with the backspace; I want the
>>pointer to back up and erase the last character, but the ' ' in
>>graphics mode doesn't do this.  I need the equivalent of ClrEol.
>>How do you do it?  Thanks in advance...

  One way I can think of is:

    Save Text Foreground color;
    Set Foreground color (text) to Background color;
    Redraw character;
    Set Text Foreground color to Save;
--
*******************************************************************************
* Dennis Ellis (dre@sequoia.cray.com) *                                       *
* Cray Research, Inc.                 *                                       *
* Eagan, MN 55121                     * All the normal stuff about opinions.. *

tony@clio.sts.uiuc.edu (Tony) (06/21/91)

dre@sequoia.cray.com (Dennis Ellis) writes:

>>>called T.  The problem is in dealing with the backspace; I want the
>>>pointer to back up and erase the last character, but the ' ' in
>>>graphics mode doesn't do this.  I need the equivalent of ClrEol.
>>>How do you do it?  Thanks in advance...

>  One way I can think of is:

>    Save Text Foreground color;
>    Set Foreground color (text) to Background color;
>    Redraw character;
>    Set Text Foreground color to Save;
This might work too
   save text color
   set foreground color to background
   write char 219 or 178 (They might be big enough)
   reset foreground color

		 Tony Chen
		 tony@clio.las.uiuc.edu