
! script name: tools.d/listtool
! topic: list information related to specific tool in the database

!A
!A NAME:
!A
!A 	LIST A TOOL
!A
!A DESCRIPTION:
!A
!A 	This script allows the information related to a specific tool in the
!A 	database to be listed.
!A
!B INSTRUCTIONS:
!B
!B 	INPUT TOOL ID NAME: The TOOLS selection box will automatically appear
!B 		to allow a tool to be selected.
!B

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

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]
DIM File$[256]

Start:!

Stat=RemoveDupTools
Stat=ToolSelectBox("TOOLS","selected tool")
IF Stat=1 THEN Leave

Stat=SetInputFormat("a99","")
Stat=GetValue("INPUT TOOL ID NAME",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave
Name$=Answer$

Tool=FindUserData(Name$,WsToolData)
IF NOT ValidGeometry(Tool) THEN Start

File$="/usr/weber/userdata/datalist"

Stat=OutputUserData(Tool,File$,WsNewFile)

Stat=MessageFileBox(File$,"TOOL  "&Name$)

GOTO Start

Leave:!

LowerSelectBox

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