Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - getscrcharattr() return the character/attribute at screen location http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getscrcharattr()    Return the character/attribute at screen location
------------------------------------------------------------------------------
 Declaration
   screen.hdr

 Syntax
   func uint getscrcharattr extern
   param value uint uRow, ;
         value uint uCol

 Arguments
   uRow is a screen row number.

   uCol is a screen column number.

 Return
   A combined character code and color attribute value.

 Description
   This function returns the current screen character and attribute at the
   specified screen position. The function performs a direct access to the
   screen memory, independent of the current screen driver.

   The result is a 2-byte uint (word) value; the low order byte contains
   the attribute, the high order byte contains the character code.

 Example
   #define EXAMPLE_SCREEN
   #include example.hdr

   proc Test_getscrcharattr
   vardef
      uint uCharAttr
      uint n
   enddef
   __syscolor[ CLR_STD ] := BLUE_YELLOW
   @ 10, 11 ?? "hello"                        // write a string to screen
   for n := 10 to 15        // copy the string to another screen location
      uCharAttr := getscrcharattr( 10, n )
      putscrcharattr( 21, 60 + n, uCharAttr )
   next
   endproc

   proc main
   Test_getscrcharattr()
   endproc

See Also: getscrattr() getscrchar() putscrcharattr()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson