# put_screen_char

Platform: | WINDOWS ONLY
Definition: | put_screen_char(integer line, integer column, sequence s)
Description: | Deprecated. Although it is unlikely to be removed anytime soon, new applications should find little need to use this routine. Write zero or more characters onto the screen along with their attributes. line and column specify where the first character should be written. The sequence s looks like: {ascii-code1, attribute1, ascii-code2, attribute2, ...}. Each pair of elements in s describes one character. The ascii-code integer contains eg 'A' (==65), and the attributes atom contains the foreground and background colors, and possibly other platform-dependent information controlling how the character is displayed on the screen.
pwa/p2js: | Not supported
Comments: | The length of s must be a multiple of 2. If s has 0 length, nothing will be written to the screen. It is faster to write several characters to the screen with a single call to put_screen_char() than it is to write one character at a time.
Example: |
    -- write AZ to the top left of the screen
    put_screen_char(1, 1, {'A', #97, 'Z', #43})
    put_screen_char(2, 1, {'A', BRIGHT_BLUE*#10+WHITE, 'Z', RED*#10+CYAN})
Note that attributes are platform-dependent; the top line best illustrates the values expected, and matches the second perfectly on Windows but disagrees on Linux, whereas the second line should work identically cross-platform. Other platform-specific bits may be present in the attributes part. Since BLACK=0 (on all platforms), omitting the *#10 part equates to a black background.
Implementation: | See builtins\pscreen.e (an autoinclude) for details of the actual implementation.
See Also: | get_screen_char, display_text_image