
! script name: interrogate.d/grouplist
! topic: list groups

!A
!A NAME:
!A
!A 	Group List
!A
!A DESCRIPTION:
!A
!A 	This script will list all groups used.
!A
!B INSTRUCTIONS:
!B
!B	No user input required. 	
!B 

stat=ChangeLabelStr("ScriptNameStatus","Function: grouplist ")

DIM Destination$[256]
DIM File$[256]
DIM Title$[256]
DIM Name$[256]
DIM A$[256]

File$= "tempdata"

group= GrpByEntType(WsGroupEnt)
IF NOT ValidGeometry(Group) THEN Leave

count1= GroupCount(group)
stat= OutputString(File$,CHR$(10),WsNewFile)
FOR I=1 TO count1
	G1= GroupElement(group,I)
	stat= GroupName(G1,Name$)
	Gcount= GroupCount(G1)

	OUTPUT A$ USING "40A,10A,6D"; Name$,"Elements  ", Gcount
        stat= OutputString(File$,A$&CHR$(10),WsAppend)
NEXT I

stat= DeleteEntity(Group)


Title$= "GROUPS"
Stat=MessageFileBox(File$,Title$)


Leave:!
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
