You can use IF
inside your statement. Something like this:
PUT UNFORMATTED 'This will output ' (IF TRUE THEN "something" ELSE "nothing").
That will output
This will output something
TRUE
can be changed to any check you want to.
However, since you use SUBSTITUTE
you could consider adding a variable for the color.
PUT UNFORMATTED SUBSTITUTE (" <tr style = 'text-align: center'>
<td style=' border: 1px solid black;border-collapse: collapse;color:&9;'>&1</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&2</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&3</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&4</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&5</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&6</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&7</td>
<td style=' border: 1px solid black;border-collapse: collapse;'>&8</td>
</tr>",
tt_data.tt_userid,
tt_data.tt_fullname,
tt_data.tt_createddate,
tt_data.tt_lastlogon,
tt_data.tt_needdisable,
tt_data.tt_needdelete,
tt_data.tt_disable,
tt_data.tt_days,
color
) SKIP.
And then your program needs to set the color variable based on whatever logic you need.
You could also match "normal" variables and the &-syntax of SUBSTITUTE:
DEFINE VARIABLE cColor AS CHARACTER NO-UNDO.
DEFINE VARIABLE iInt AS INTEGER NO-UNDO.
cColor = "black".
iInt = 12.
MESSAGE SUBSTITUTE("This is a color " + cColor + " and a number &1", iInt).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…