Board index » delphi » character programming function

character programming function

Hi,

Can someone please provide me with a function
that, given (x, y) will return, in char, the character
in that position on the screen.

Thanks
-Nicolas

 

Re:character programming function


Quote
Nicolas Goosen wrote:
> Can someone please provide me with a function
> that, given (x, y) will return, in char, the character
> in that position on the screen.

Video memory starts at $B800:0. Each character on the screen occupies
two bytes in memory, one for the character itself and one for its
attributes. The screen consists of 25 rows with 80 columns each.

With this information, you should be able to write the function
yourself.

Re:character programming function


JRS:  In article <37D8071F.34043...@altavista.net> of Thu, 9 Sep 1999
21:14:39 in news:comp.lang.pascal.borland, Frederic <f...@altavista.net>
wrote:

Quote
>Nicolas Goosen wrote:

>> Can someone please provide me with a function
>> that, given (x, y) will return, in char, the character
>> in that position on the screen.

>Video memory starts at $B800:0. Each character on the screen occupies
>two bytes in memory, one for the character itself and one for its
>attributes. The screen consists of 25 rows with 80 columns each.

Please do not assume that that is a safe assumption.  More often than
not, I work in 50*80; and, for some work, I would also increase the
width if it was equally easy to do so.  Many will be willing to assume
it for their own work, of course.

One should always read the current size from Seg0040.

Likewise, one should not assume that the keyboard buffer is in its
default position.

--
 ? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
  <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c. FAQqish topics, links.
  Timo's TurboPascal <A HREF="ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip">FAQ</A>.
  <A HREF="http://www.merlyn.demon.co.uk/clpb-faq.txt">Mini-FAQ</A> of c.l.p.b.

Re:character programming function


In article <7r8tor$1m4...@nnrp01.ops.uunet.co.za>,

Quote
Nicolas Goosen <nick...@iafrica.com> wrote:
>Hi,

>Can someone please provide me with a function
>that, given (x, y) will return, in char, the character
>in that position on the screen.

From Ralf Brown's interrupt list:

--------V-1008-------------------------------
INT 10 - VIDEO - READ CHARACTER AND ATTRIBUTE AT CURSOR POSITION
        AH = 08h
        BH = page number (00h to number of pages - 1) (see AH=00h)
Return: AH = charater's attribute (see below)
        AL = character
...

Osmo

Other Threads