
! script name: delete.d/deleteall
! topic: delete all

!A
!A NAME:
!A
!A 	Delete All
!A
!A DESCRIPTION:
!A
!A 	This script will delete everything that has been constructed.
!A 	Delete All returns named variables to the original value.
!A
!B INSTRUCTIONS:
!B
!B 	ARE YOU SURE Yes or No: Enter "Y" to have everything deleted,
!B 		enter "N" to abort the deletion process.
!B

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

DIM Destination$[256]
DIM Answer$[256]

DeActivateUndo
Stat=SetInputFormat("a1=",",Y,N,")
Stat=SetEqualsValue(0,"y")
Stat=GetValue("DO YOU WANT TO DELETE ALL?  Yes or No",Answer$)
IF (ExitScript(Destination$)) THEN Leave

IF Answer$="Y" THEN
	stat= NamedVarStr("startup script",WsSystemVars,"startup",Answer$)
	DeleteAll
	StdWorkplane
	Stat= RemoveFile("synfile")
        Stat= RemoveFile("command_buffer")
        Stat= RemoveFile("tapelist")
        Stat= RemoveFile("timefile")
        Stat= RemoveFile("tempdata")
        Stat= RemoveFile("tempscript")
        Stat= RemoveFile("tempfile")
        Stat= RemoveDirFiles("./","*","command_file")
        Stat= RemoveDirFiles("./","*","notepad")
        Stat= RemoveDirFiles("./","*","tapefile")
        Stat= RemoveDirFiles("./","*","tapefil")
        Stat= RemoveDirFiles("./","*","",".gif")
        Stat= RemoveDirFiles("./","*","",".jpg")
        Stat= RemoveDirFiles("./","*","",".html")
        Stat= RemoveDirFiles("./","*","",".htm")
        Stat= RemoveDirFiles("./","*","",".hpgl")
        Stat= RemoveDirFiles("./","*","",".plt")
	Stat=ChangeLabelStr("websys","Synergy Command Window")
	LOAD Answer$
ELSE
	LOAD "typecontrol"
END IF


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