
! script name: datatable.d/entryltype
! topic: Sample - change entry line type in a table

!A
!A NAME:
!A
!A 	Change Entry Line Type in a Table
!A
!A DESCRIPTION:
!A
!A 	This script will change an entry line type in a table.
!A
!B INSTRUCTIONS:
!B
!B 	TEXT WIDTH Normal, Wide, X wide, XX wide: Thickness in pixels when
!B 		drawn on the screen. On a plotter the user should use a
!B 		thicker pen and a slower speed.
!B
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C
!# see also - htdocs/help.d/datatables.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: Entry Line Type ")

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


ActivateUndo
Start:!

stat= SetInputFormat("a2=",",N,W,X,XX,")
Stat=SetEqualsValue(0,"N")
Stat= GetValue("TEXT WIDTH Normal, Wide, X wide, XX wide  ",Answer$)
IF (ExitScript(Destination$)) THEN Leave

SELECT Answer$
CASE "N"
        Ltype1= 1
CASE "W"
        Ltype1= 9
CASE "X"
        Ltype1= 10
CASE "XX"
        Ltype1= 11
END SELECT

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("entry ltype")
Stat= AddItemToUndo(WsUBModifyMode,Element1)

Stat= PlotDataTable(Element1,R1,C1,-1)
Stat= SetTableLType(Element1,R1,C1,Ltype1)
Stat= PlotDataTable(Element1,R1,C1,0)

GOTO Element_loop

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