
! script name: filing.d/changedir
! topic: change working directory

!A
!A NAME:
!A
!A 	Change Working Directory
!A
!A DESCRIPTION:
!A
!A 	This script changes the current working directory.
!A
!B INSTRUCTIONS:
!B
!B 	SELECT NEW WORKING DIRECTORY: The selection box will appear
!B		at this time for a selection to be made.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: change working directory")

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]

Dir$=SYSTEM$("MSI")
D_label$="CURRENT DIRECTORY PATH"
Sub_label$="DIRECTORIES"
F_label$=""
Choice$="NEW WORKING DIRECTORY"
Mask$="."

Stat=UserFileBox(Dir$,Mask$,D_label$,Sub_label$,F_label$,Choice$)
Stat=SetInputFormat("a99","")
Stat=GetValue("SELECT NEW WORKING DIRECTORY",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "CANCEL" THEN Leave
LowerFileBox

MSI Answer$

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

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

