
! script name: amo.d/amolist

!A
!A NAME:
!A
!A 	LIST
!A
!A DESCRIPTION:
!A
!A 	This script allows the selection of a list option.
!A 	the following are the present choices:
!A 		LIST TAPE FILE
!A 		LIST COMMAND FILE
!A 		LIST MACHINE TIME
!A 		NOTEPAD
!A 		LIST FORMAT FILE
!A 		LIST MACRO FILE
!A
!B INSTRUCTIONS:
!B
!B 	SELECT POST FUNCTION: The LIST OPTIONS selection
!B 		box will automatically appear to allow the
!B 		selection of a list option for TurboPost.
!B
!# see also - htdocs/help.d/millturbo.htm

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

DIM Operations$[10000]
DIM Substr$[256]
DEG


DeActivateUndo
Start:!
Task_ent= FindUserData("AMO OPERATIONS",WsTaskPacket)
Oper_grp= FindNamedGrp("AMO OPERATIONS")
IF NOT ValidGeometry(Task_ent) AND NOT ValidGeometry(Oper_grp) THEN Leave

IF ValidGeometry(Task_ent) THEN
	Number= GetUserValue(Task_ent,"Number tools:")
ELSE
	Number= GroupCount(Oper_grp)
END IF
Operations$= ""
FOR I= 1 TO Number
	IF ValidGeometry(Task_ent) THEN
		Substr$= UserDataStr(Task_ent,"Tool "&VAL$(I)&":")
	ELSE
		E1= GroupElement(Oper_grp,I)
		Stat= GetUserDataName(E1,Substr$)
	END IF
	Substr$= RPT$(" ",2-(I>9)-(I>99))&VAL$(I)&"- "&Substr$
	Operations$= Operations$&Substr$&RPT$(CHR$(10),I<>Number)
NEXT I

Stat= MessageStringBox(Operations$,"OPERATIONS LIST")

Leave:!
LOAD "typecontrol"
END
