
! script name: milacron.d/editdatafile
! topic: edit the screw data file


!A
!A NAME:
!A
!A 	Edit Screw Data File
!A
!A DESCRIPTION:
!A
!A 	This script allows the screw data file to be edited.
!A	The screw must then be regenerated completely by using Read Zone File
!A
!B INSTRUCTIONS:
!B
!B 	SELECT FILE: A File selection box will appear at this
!B 		time to allow the filename/location to be specified.
!B
!B NOTES:
!B

DIM Answer$[256],Destination$[256],Dir$[256],D_label$[256],Dir1$[256]
DIM Sub_label$[256],F_label$[256],Choice$[256],Mask$[256],Group_name$[256]
DIM Decision$[256],Mode$[128]
DIM Startup$[256],Setconstants$[256]
DIM A$[3000],B$[80],File$[256]
DIM Store_dir$[255],Retrieve_dir$[255],Pics_dir$[255]
DIM Fileheader$[256],Header$[4096],Units$[256]

DIM Name$[512]
DIM Prop_dir$[512]
DIM Screw_dir$[512]
DIM Screw_name$[512]
DIM Prop_file$[512]
DIM Ques$[512]
DIM Mask$[512]
DIM D_label$[512]
DIM F_label$[512]
DIM Sub_label$[512]
DIM Choice$[512]
DIM Dir$[512]
DIM Editor$[256]

OPTION BASE 1

Stat= NamedVarStr("file editor",WsSystemVars,"notepad.exe",Editor$)
Flip_file= NamedVarVal("flip crlf",WsSystemVars,0)

Stat=ChangeLabelStr("ScriptNameStatus","Function: Edit Screw Data File ")

Stat= NamedVarStr("retrieve dir",WsSystemVars,"/usr/weber/ST/",Dir$)
D_label$="DIRECTORY"
Sub_label$="SUB DIRECTORIES"
F_label$="FILES"
Choice$="FILE TO OPEN"
Mask$= "Zone Files (*.wbr)|*.wbr|"
Mask$= Mask$&"All Files (*.*)|*.*||"

Stat=UserFileBox(Dir$,Mask$,D_label$,Sub_label$,F_label$,Choice$,"Synergy")
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT EXISTING ZONE FILE",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave
LowerFileBox

File$=Answer$
Stat=EditFile(Editor$,File$,Flip_file,WsFalse)

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

