
! script name: datatable.d/colorrow
! topic: Sample - color the entries in a row of a table

!A
!A NAME:
!A
!A 	Color entries in a row of a table
!A
!A DESCRIPTION:
!A
!A 	This script will color the entries in a row of a table.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ROW: Pick the row to be colored.
!B
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C
!# see also - htdocs/help.d/datatables.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: Color table row ")

DIM Answer$[256]
DIM A$[256]
DIM Destination$[256]
DEG

ActivateUndo
Pen_color= CurrentColor
RaiseColorBox

Start:!

Element_loop:!
stat= SetInputFormat("n4","")
Element1=PickEntity("PICK ROW")
IF (ExitScript(Destination$)) THEN Leave
IF NOT ValidGeometry(Element1) THEN Element_loop
T1= LastPickPara

R1=TableParaRow(Element1,T1)
C1=TableParaColumn(Element1,T1)


ActivateUndo
Stat= AdvanceUndoNumber("color row")
Stat= AddItemToUndo(WsUBModifyMode,Element1)

Color1= CurrentColor
Stat= SetTableColors(Element1,R1,0,Color1)
Stat= PlotDataTable(Element1,R1,0,0)

GOTO Element_loop

Leave:!
stat= SetInputFormat("n4","")
Stat= SetCurrentColor(Pen_color)
LowerColorBox
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
