
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FORCE Data Base Compiler - ##############################################################################
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+----------+###############################################################
#+-| CURCOLOR |----------------------------------+############################
#| +----------+ Draw vertical cursor bar without |############################
#| affecting information on screen |############################
#+-----------------------------------------------+############################
##############################################################################
##############################################################################
#+--| Summary |------------+##################################################
#| #INCLUDE io.hdr |##################################################
#+-------------------------+##################################################
##############################################################################
##############################################################################
#+--| Syntax |-----------------------------------------+######################
#| PROCEDURE curcolor PROTOTYPE |######################
#| PARAMETERS VALUE INT row, VALUE INT col,; |######################
#| VALUE INT color, VALUE INT length |######################
#+-----------------------------------------------------+######################
##############################################################################
##############################################################################
#####+---| Description |-------------------------------------------------+####
#####| This procedure paints a vertical bar at row,col for length length |####
#####| with color attribute of color. It DOES NOT erase the information |####
#####| on the screen; it only changes the color attribute of the screen. |####
#####| ----------------------------------------------------------------- |####
#####| Use this function to create a cursor bar for a menu system, or to |####
#####| quickly change the attribute of a string on the screen without |####
#####| having to repaint the string. |####
#####| ----------------------------------------------------------------- |####
#####| Common color attributes are described in colors.hdr. |####
#####+-------------------------------------------------------------------+####
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Have a message "WAKE UP!!" flash on the screen |#########
#########| * in different colors if user does not press a |#########
#########| * key within 5 minutes. |#########
#########| |#########
#########| @ 10,35 ?? "Press a key" |#########
#########| |#########
#########| k = delay( 5*60 ) |#########
#########| IF k = 0 |#########
#########| @ 11, 37 ?? "WAKE UP!!" |#########
#########| REPEAT |#########
#########| curcolor(11,37,&CYAN_RED,len("WAKE_UP!!")) |#########
#########| curcolor(11,37,&RED_CYAN,len("WAKE_UP!!")) |#########
#########| UNTIL is_key() <> 0 |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Move a cursor bar up |#########
#########| |#########
#########| the_key = get_key() |#########
#########| IF the_key = &K_UP |#########
#########| curcolor(r,c,normal, plength) |#########
#########| r = r - 1 |#########
#########| curcolor(r,c,highlight, plength) |#########
#########| ENDIF |#########
#########| {...} |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also: __color_std __color_enhcd SET COLOR TO scroll
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson