
! script name: datatable.d/fillentryon
! topic: change the fill color of a table entry

!A
!A NAME:
!A
!A 	Entry Fill Color
!A
!A DESCRIPTION:
!A
!A 	This script allows the fill color of a table entry to be changed.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ENTRY: Pick the entry to be filled.
!B
!# see also - htdocs/help.d/datatables.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: fill table entry ")

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

ActivateUndo
Pen_color= CurrentColor
RaiseColorBox

Start:!

Element_loop:!
stat= SetInputFormat("n4","")
Element1=PickEntity("PICK ENTRY ")
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("fill entry")
Stat= AddItemToUndo(WsUBModifyMode,Element1)

Color1= CurrentColor
Stat= SetEntryFillColor(Element1,R1,C1,Color1)
Stat= PlotDataTable(Element1,R1,C1,0)

GOTO Element_loop

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