Terminal control/Coloured text: Difference between revisions

m
→‎PC/REXX or Personal REXX: consolidated ("overlaid") code with a comment box to save program statements. -- ~~~~
(moved ooRexx to its own section. -- ~~~~)
m (→‎PC/REXX or Personal REXX: consolidated ("overlaid") code with a comment box to save program statements. -- ~~~~)
Line 317:
<br><br>The program displays 16 lines, each of a different color with text stating the color of the text.
<br>(The black text, of course, is essentiall invisible as the background is also black.)
<lang rexx>/*REXX*/ parse arg !; if !all(arg()) then exit /*exit if documentation specified*/
if \!dos & \!os2 then exit /*if this isn't DOS, then exit. */
if \!pcrexx then exit /*if this isn't PC/REXX, exit. */
 
color.0 = 'black' /*┌─────────────────────────────┐*/
if \!dos & \!os2 then exit /*if this isn't DOS, then exit. */
ifcolor.1 \!pcrexx then= exit'dark blue' /*if this isn't PC/REXXNormally, all programs exit. issue│*/
color.2 = 'dark green' /*│ the (above) error messages │*/
 
color.3 = 'dark cyan/turquois' /* The "real" programs issue all errors through another REXX program│*/
color.4 = 'dark red' /*│ ($ERR) program which has more verbage and explanation, and */
color.5 = 'dark pink/magenta' /* issuesverbage the errorand text inexplanations, red (if color is avaiable).*/
color.6 = 'dark yellow (orange)' /*│ and issues the error text in│*/
 
color.7 = 'dark white' /*│ red (if color is available).│*/
color.0 = 'black'
color.8 = 'brite black (grey/gray)' /*└─────────────────────────────┘*/
color.1 = 'dark blue'
color.2 = 'dark green'
color.3 = 'dark cyan/turquois'
color.4 = 'dark red'
color.5 = 'dark pink/magenta'
color.6 = 'dark yellow (orange)'
color.7 = 'dark white'
color.8 = 'brite black (grey/gray)'
color.9 = 'bright blue'
color.10 = 'bright green'
Line 343 ⟶ 338:
color.15 = 'bright white'
 
do j=0 to 15 /*show all sixteen color codes. */
call scrwrite ,,'color code=['right(j,2)"]" color.j,,,j; say
end /*j*/ /*the "SAY" forces a NEWLINE. */
exit /*stick a fork in it, we're done.*/
 
Line 355 ⟶ 350:
!rex:parse upper version !ver !vernum !verdate .;!brexx='BY'==!vernum;!kexx='KEXX'==!ver;!pcrexx='REXX/PERSONAL'==!ver|'REXX/PC'==!ver;!r4='REXX-R4'==!ver;!regina='REXX-REGINA'==left(!ver,11);!roo='REXX-ROO'==!ver;call !env;return
!sys:!cms=!sys=='CMS';!os2=!sys=='OS2';!tso=!sys=='TSO'|!sys=='MVS';!vse=!sys=='VSE';!dos=pos('DOS',!sys)\==0|pos('WIN',!sys)\==0|!sys=='CMD';call !rex;return
!var:call !fid;if !kexx then return space(dosenv(arg(1)));return space(value(arg(1),,!env))</lang>
 
=={{header|Tcl}}==