ColourToN() - Convert color string to numeric value
Converts NN/NN or CC/CC color values into numeric values
──────────────────────────────────────────────────────────────────────────────
Syntax
ColorToN(<cAttr>) --> nAttr
Argument
<cAttr> is the colour attribute that is converted from NN/NN or CC/CC
to it's numeric value.
Returns
ColorToN() returns a number that represents the numeric form of the
color string.
Description
ColorToN() changes a colour string attribute from NN/NN or CC/CC to
it's numeric equivalent
Notes
■ Passing an invalid colour string will result in a return value of 0
(black on black)
■ Passing a valid numeric colour attribute to this function will result
in a return value of the original numeric form
■ This function does not alter the cursor position.
Examples
■ Convert these:
? ColorToN("07") // returns 7
? ColorToN("07/00") // returns 7
? ColorToN("W/N") // returns 7
■ red on white:
? ColorToN("04/07") // returns 116
? ColorToN("R/W") // returns 116
■ If the foreground colour is missing then 0 is assumed.
? ColorToN("/7")
■ High intensity (+) and flashing (*) are also recognized:
? ColorToN("BR+")
? ColorToN("BR+*")
? ColorToN("G/BR+*")
? ColorToN("+G*/BR")
Files: Library is MRWINDOW.LIB.