
! script name: property.d/prophtmltable
! topic: make an html  table from an info packet class directory

!A
!A NAME:
!A
!A 	Html Property Table
!A
!A DESCRIPTION:
!A
!A 	This script creates a html table using data from an info packet
!A 	directory.  A html table uses the hypertext markup language to
!A 	create tables that can be viewed by a browser and shared across
!A 	computer platforms. A html table will appear the same on a HP
!A 	system as it does on a Windows system.  Html tables can also be
!A 	easily imported into many of today's data processing programs.
!A
!B INSTRUCTIONS:
!B
!B	PACKET CLASS DIRECTORY: Select the packet directory that
!B 	you wish to make a table from.
!B
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: make html packet table")

DIM Destination$[512]
DIM Answer$[512]
DIM A$[512]
DIM B$[512]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Prop_class$[512]
DIM Class_dir$[512]
DIM Filename$[512]
DIM Table_name$[512]
DIM Table_title$[512]
DIM Class_name$[512]
DIM Namelist$[32000]
DIM Filelist$[32000]
DIM D_label$[512]
DIM Choice$[512]
DIM Current_dir$[512]
DIM Ques$[512]

Stat= NamedVarStr("properties dir",WsSystemVars,"/usr/weber/database/properties/",Prop_dir$)

Table_name$= "HTML PACKET TABLE"

Grid_color= 18
Entry_color= 12
Entry_text_height= GetDefault(WsTextHeight)
Entry_text_width= GetDefault(WsTextWidth)

Header_color= 17
Head_text_height= 1.2*Entry_text_height
Head_text_width= 1.2*Entry_text_width
Header_slant= TAN(20)



Start:!
D_label$="PACKET CLASSES"
Choice$="CLASS SELECTED"
Ques$= "PACKET CLASS DIRECTORY  List  "
Answer$= SelectDirectory(Prop_dir$,"*",Ques$,D_label$,Choice$,"",Current_dir$)
IF (ExitScript(Destination$)) THEN Leave
IF  Answer$= "CANCEL" THEN Leave
Answer$= TRIM$(Answer$)
Class_dir$= Answer$
Prop_class$= PathNameFile(Answer$)
LowerSelectBox

Table1= FindNamedEntity(Table_name$)
IF Table1 THEN Stat= DeleteEntity(Table1)

Table_title$= Answer$

PlotOff
Pc= PointXYZ(0,0,0)
Table1= TableFromPropDir(Class_dir$,Pc,":",WsUpperLeft,WsAscending)
Stat= DeleteEntity(Pc)

Set_table_props:!
IF NOT ValidGeometry(Table1) THEN Start
Stat= TableTextOrigin(Table1,1,0,WsCenterText)
Stat= SetTableColors(Table1,0,0,Entry_color)
Stat= SetTableColors(Table1,1,0,Header_color)
Stat= TableTextSizes(Table1,1,0,Head_text_width,Head_text_height,Header_slant)
Stat= SetColor(Table1,Grid_color)
Stat= NameEntity(Table1,Table_name$)
PlotOn

LOAD "datatable.d/exporthtml: 0,"&Table_name$&",1,"&Table_title$

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


