
! script name: filing.d/deletefile
! topic: delete stored job

!A
!A NAME:
!A
!A 	Delete File
!A
!A DESCRIPTION:
!A
!A 	This script deletes a stored job.
!A
!B INSTRUCTIONS:
!B
!B 	SELECT EXISTING JOB FILE: The selection box will
!B 		appear at this time for a selection to be made.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: delete file ")

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]
DIM Store_dir$[255]

Start:!
Stat= NamedVarStr("retrieve dir",WsSystemVars,"/usr/weber/ST/",Dir$)
D_label$="DIRECTORY"
Sub_label$="SUB DIRECTORIES"
F_label$="FILES"
Choice$="FILE TO OPEN"
Mask$="[A-Za-z0-9]*"

StdWorkplane

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

Stat=SetInputFormat("a1",",Y,N,")
Stat=GetValue("DELETE: "&Name$&" Yes or No ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "N" THEN Leave

Stat= RemoveFile(Name$)

GOTO Start

Leave:!
LowerFileBox
Stat=SetInputFormat("n4","")

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

