
! script name: edit.d/edituserdata
! topic: allows selection of user data option

!A
!A NAME:
!A
!A 	Edit User Data
!A
!A DESCRIPTION:
!A
!A 	This script allows the selection of an user data
!A 	option.  The following are the present choices:
!A
!A 		MATERIAL FILE
!A 		TOOL FILE
!A 		OPERATION FILE
!A 		NAMED VARIABLES
!A
!B INSTRUCTIONS:
!B
!B 	SELECT EDIT FUNCTION: The EDIT USER DATA OPTIONS
!B 		selection box will automatically appear
!B 		to allow the selection of a user data option.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: edit user data ")

DIM Answer$[256]
DIM Name$[256]
DIM Destination$[256]
DIM Title$[256]
DIM Label$[256]
DIM Namelist$[5000]
DIM Post_name$[256]
DIM Dir$[256]
DIM Mask$[256]
DIM Directory$[256]

DEG

Start:!
Directory$= "edit.d"
Title$="EDIT USER DATA"
Label$="FUNCTION SELECTED"
Namelist$="MATERIAL FILE,"
Namelist$=Namelist$&"TOOL FILE,"
Namelist$=Namelist$&"OPERATION FILE,"
Namelist$=Namelist$&"NAMED VARIABLES,"

Stat=GeneralListBox(Title$,Label$,Namelist$)
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT EDIT FUNCTION",Answer$)
IF (ExitScript(Destination$)) THEN Leave

LowerSelectBox
stat= SetInputFormat("n4","")
Name$=Answer$
SELECT Name$
CASE "MATERIAL FILE"
	LOAD FileNameString(Directory$,"editmaterial")
	
CASE "TOOL FILE"
	LOAD FileNameString(Directory$,"edittool")

CASE "OPERATION FILE"
	LOAD FileNameString(Directory$,"editoperation")

CASE "NAMED VARIABLES"
	LOAD FileNameString(Directory$,"editvars")

CASE "CANCEL"
	 GOTO Leave
END SELECT

GOTO Start

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