Dynamically format colors in lists
I would like to dynamically set a color for a single in a list.
Ie rather than code:
If var = 'x'. write l_field color col_negative.
elseif var = 'y' write l_field color col_total.
elseif var = 'z' write l_field color col_group.
I would like to code it as follows:
data: l_color(10) type c.
if l_var = 'x'.
move 'col_negative' to l_color.
elseif l_var = 'y' move 'col_total to l_color.
elseif l_var = 'z' move 'col_group' to l_color.
write: l_field color l_color.
The color command does not seem to like being passed a variable, rather it has to be told explicitly what the color should be set at.
Is there a way around this?