
! script name: items.d/listentitems
! topic: list all item flags associated to an entity

!A
!A NAME:
!A
!A 	List Entity Item Flags
!A
!A DESCRIPTION:
!A
!A 	List all the item flags associated with an entity.  This allows you to
!A 	verify that an entity has the proper item flags associated with it.
!A
!B INSTRUCTIONS:
!B
!B 	PICK ENTITY: Pick the entity that contains the item flags that you
!B 	want listed.  The script will list the item flags associated with
!B 	this entity.
!B
!# see also - htdocs/help.d/items.htm
!# see also - htdocs/help.d/property.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: list entity items ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]
DIM Class$[256]
DIM A$[256]
DIM B$[256]
DIM File$[256]

File$= "tempdata"
Stat= RemoveFile(File$)
Start:!


Pick_entity:!
Stat= SetInputFormat("n4","")
E1=PickEntity("PICK ENTITY")
IF ExitScript(Destination$) THEN Leave


Group= EntityItemGroup(E1,WsDescending)
IF NOT ValidGeometry(Group) THEN Start
Nitems= GroupCount(Group)
IF Nitems= 0 THEN Leave

stat= OutputString(File$,CHR$(10),WsNewFile)
FOR Item= 1 TO Nitems
	Element= GroupElement(Group,Item)
	Name$= UserDataStr(Element,"Name:")
	Class$= UserDataStr(Element,"Class name:")
	A$= Class$&" : "&Name$&CHR$(10)
	stat= OutputString(File$,A$,WsAppend)
NEXT Item
stat= OutputString(File$,CHR$(10),WsAppend)
Stat=MessageFileBox(File$,"ITEM LIST")
Stat= DeleteEntity(Group)

GOTO Start

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