
! script name: layers.d/setcurrlayer
! topic: assign current layer

!A
!A NAME:
!A
!A 	Change Current Layer
!A
!A DESCRIPTION:
!A
!A 	This script allows the current layer to be defined.  The default
!A 	layer is "0".
!A
!B INSTRUCTIONS:
!B
!B 	LAYER NUMBER   current layer = #: Enter the layer number to be used.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: change current layer ")

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

Layer=CurrentLayer

Ask_layer=1
IF ARGC> 1 THEN Ask_layer=0

IF Ask_layer THEN
        Stat=SetInputFormat("n0=","")
        Stat= SetEqualsValue(Layer)
        Layer=InputLayer("LAYER NUMBER ")
        IF (ExitScript(Destination$)) THEN Leave
        Stat= SetCurrentLayer(Layer)
END IF

Stat=SetCurrentLayer(Layer)

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