
! script name: plot.d/layermovie

!A
!A NAME:
!A
!A 	Layer Movie
!A
!A DESCRIPTION:
!A
!A
!B INSTRUCTIONS:
!B
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: layer movie ")

DIM Destination$[256]
DIM Answer$[256]
DIM Name$[256]
DIM Layers$[256]
DIM Colors$[256]
DIM Part_layers$[256]

Start:!


Stat=SetInputFormat("a99","")
Stat= GetValue("PART LAYERS  None ",Answer$)
IF (ExitScript(Destination$)) THEN Leave
IF Answer$= "N" OR Answer$= "n" OR Answer$= "None" OR Answer$= "NONE" THEN
	Part_layers$= ",999999,"
ELSE
	Part_layers$= ","&Answer$&","
END IF

Stat= SetInputFormat("n0","")
L1=InputLayer("STARTING LAYER NUMBER")
IF (ExitScript(Destination$)) THEN Leave

Stat= SetInputFormat("n0","")
L2=InputLayer("ENDING LAYER NUMBER")
IF (ExitScript(Destination$)) THEN Leave


Step1= 1
IF L1> L2 THEN Step1= -1

No_stops=0
FOR I= L1 TO L2  STEP Step1
	Layers$= Part_Layers$&VAL$(I)
	Stat=SetPlotLayers(","&Layers$&",")
	UpdatePlot

	IF No_stops= 0 THEN
		Stat=SetInputFormat("a1=",",C,N,E,B,")
		Stat= SetEqualsValue(0,"C")
		Stat= GetValue("SHOW Continue, Back, No stops, End",Answer$)
		IF (ExitScript(Destination$)) THEN Leave
		IF Answer$= "E" THEN Exit_loop
		IF Answer$= "N" THEN No_stops=1
		IF Answer$= "B" THEN 
			I= I-2
			IF I< 0 THEN I=0
		END IF
	END IF

NEXT I

Exit_loop:!
Stat=SetPlotLayers("")
UpdatePlot

GOTO Start

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

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