Please enable JavaScript to view this site.

ASQL Reference

Navigation: » No topics above this level «

Background cell color

Scroll Prev Top Next More

cformat switch: B

Sample images here and here and here.

Allows you to specify custom background colors for individual cells. Unlike the other color column codes (b, C, c) this one is usually specified in conjunction with some other column type. The first character of the column data is assumed to be an RGB Color Index (see RGBfg) Any other value, or if the specified color index does not reference an RGBfg or RGBbg definition, then that cell will have the normal background color. Typically you would put a space in the first position for all the "normal" cells, and just use this feature to highlight a few special cells in the column. For example, if the cell contained "Asold out", it would display "sold out" with the background color associated with RGB color index A. Note that if you want the cell to be blank (i.e. just show a color), do not put any other data in the column, but use the Dspwid option to set the display width of the column.

Also note that if the column contains editable data (E,U,u,T) then the first byte of the corresponding field in the Answer array must also be reserved for color codes. (As of 968.6, this is true even for checkboxes, which previously always occupied only one column in the answer array.) The purpose of using up an extra byte of the answer array for the cell color flag is to allow you to update the color of individual cells during editing validation. To simplify this, the color codes returned on exit will always be blank. Leaving them blank on re-entry causes the previously established color for the cell to be preserved. If you plug in an RGBbg color index value in the answer array for a particular cell and re-enter, that cell's color will immediately be updated accordingly.

See Also