Open
Description
The QBColor
function returns color values used by earlier versions of Basic (such as Microsoft Visual Basic for MS-DOS and the Basic Compiler), and as such should be considered deprecated.
Furthermore, while the function accepts an integer, a run-time error occurs if the parameter value isn't between 0 and 15, and the values that are between 0 and 15 are not meaningful.
50% of the returned values are already defined as constants in VBA.ColorConstants
RD should inspect for usages of QBColor
and suggest replacing with a color constant or an RGB
function. RD should also inspect for usages of QBColor
where the index might not be in the 0-15 range.
Index RGB (Hex) VBA.ColorConstants
0 &H000000 'vbBlack
1 &H800000
2 &H008000
3 &H808000
4 &H000080
5 &H800080
6 &H008080
7 &HC0C0C0
8 &H808080
9 &HFF0000 'vbBlue
10 &H00FF00 'vbGreen
11 &HFFFF00 'vbCyan
12 &H0000FF 'vbRed
13 &HFF00FF 'vbMagenta
14 &H00FFFF 'vbYellow
15 &HFFFFFF 'vbWhite