
! script name: property.d/listpropfiles
! topic: list the names of the info packets in a specific directory

!A
!A NAME:
!A
!A 	List Property Class Files
!A
!A DESCRIPTION:
!A
!A 	This script lists the names of the info packets in a specific class
!A 	directory.  It gives you the opportunity to see what info packets
!A 	exist in given class, and will help you in choosing which packets
!A 	to attach.
!A
!# see also - htdocs/help.d/property.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: list info packet files")

DIM Destination$[512]
DIM Answer$[512]
DIM A$[512]
DIM Name$[512]
DIM Prop_dir$[512]
DIM Class_dir$[512]
DIM Class_name$[512]
DIM Filename$[512]
DIM Class_name$[512]
DIM Namelist$[32000]
DIM Namelist2$[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$)

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$
Class_name$= PathNameFile(Answer$)


Mask$="*"
Stat=DirectoryNames(Class_dir$,Mask$,Namelist$)
Stat= AlphabeticalOrder(Namelist$,",",WsAscending,Namelist2$)

Stat= ReplaceChar(Namelist2$,",",CHR$(10),Namelist$)

Stat= MessageStringBox(Namelist$,"Info packets: "&Class_name$)

GOTO Start

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


