
! script name: layers.d/namelayer
! topic: create a named layer

!A
!A NAME:
!A
!A 	Create Named Layer
!A
!A DESCRIPTION:
!A
!A 	This script names a layer.
!A
!B INSTRUCTIONS:
!B
!B 	LAYER NUMBER: Enter the layer number to be named.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: created named layer ")

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

Layer=CurrentLayer

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

Stat=SetInputFormat("a99","")
Stat=GetValue("LAYER NAME",Answer$)
IF ExitScript(Destination$) THEN Leave
Name$=Answer$

Stat=SetCurrentLayer(Layer)
Stat= CreateNamedLayer(Layer,Name$)
GOTO Start

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