
! script name: ncout.d/exportcnc
! topic: Sample - export CNC

!A
!A NAME:
!A
!A 	Export CNC
!A
!A DESCRIPTION:
!A
!A 	export CNC
!A
!B INSTRUCTIONS:
!B
!B 	NO HELP AVAILABLE AT THIS TIME
!B
!C NOTE:
!C
!C 	This is an unsupported sample script.
!C

stat=ChangeLabelStr("ScriptNameStatus","Function: export cnc ")

DIM Answer$[256]
DIM Destination$[256]
DIM Name$[256]
DIM Dir$[256]
DIM D_label$[256]
DIM Sub_label$[256]
DIM F_label$[256]
DIM Choice$[256]
DIM Mask$[32]

Stat= NamedVarStr("retrieve dir",WsSystemVars,"/usr/weber/ST/",Dir$)
D_label$="DIRECTORY"
Sub_label$="SUB DIRECTORIES"
F_label$="TAPES"
Choice$="FILE TO EXPORT"
Mask$="*.tpe"

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

Stat=SetInputFormat("n0","")
Port_no=GetValue("PORT #",Answer$)
IF (ExitScript(Destination$)) THEN Leave

Stat= StartProcess("/usr/weber/bin/send.ksh "&Name$&" "&VAL$(Port_no))

Leave:!
LowerFileBox

Stat=SetInputFormat("n4","")

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