
! script name: vlathetools.d/toolstrategy
! var_topic: execute a tool holder strategy

!A
!A NAME:
!A
!A	Execute a lathe tool holder strategy.
!A
!A DESCRIPTION:
!A
!A	This script is designed to select for execution strategies which
!A	create lathe tool shapes.
!A
!B INSTRUCTIONS:
!B
!B	A strategy to create a lathe tool shape can be made using the
!B	other scripts in this directory combined with variational design.
!B	Any strategy added to the directories:
!B
!B		 /usr/weber/database/strategies/ShankHolders 
!B		 /usr/weber/database/strategies/BoringBars 
!B
!B	will be displayed in a Menu for selection.
!B
!C NOTE:
!C	
!C
!# see also - vlathetools.d/latheholders.hlp

Stat=ChangeLabelStr("ScriptNameStatus","Function: exec tool strategy ")

DIM Destination$[256]
DIM Answer$[256]
DIM A$[256]
DIM B$[256]
DIM Name$[256]
DIM Holder_file$[256]
DIM Class_dir$[256]
DIM Holder_class$[256]
DIM Filename$[256]
DIM Base_dir$[256]
DIM D_label$[256]
DIM Choice$[256]


DeActivateUndo
Stat= NamedVarStr("strategy directory",WsStrategyVars,"/usr/weber/database/strategies/",Base_dir$)

IF ARGC<2 THEN
	A$="ShankHolders"
ELSE
        A$= ARGV(1)
END IF

Start:!
Class_dir$= FileNameString(Base_dir$,A$)
Holder_class$= A$

Ask_file:!
D_label$= Holder_class$
Choice$= Holder_class$&" SELECTED"
Stat=DirListBox(Class_dir$,"*",D_label$,Choice$,WsAscending)

File_name:stat= SetInputFormat("a99","")
stat= GetValue("HOLDER TYPE ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$="CANCEL" THEN Leave
IF NOT LEN(Answer$) THEN File_name
Holder_file$= TRIM$(Answer$)
Filename$= FileNameString(Class_dir$,Holder_file$)

Destination$= "vstrategy.d/strategytools:"&Filename$

V8=CreateVariable("single strategy",WsStrategyVars,1)

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

