
! script name: views.d/applyview
! topic: apply named view

!A
!A NAME:
!A
!A	Apply Named View. 	
!A
!A DESCRIPTION:
!A
!A 	This script allows a named view to be applied to a window.
!A
!B INSTRUCTIONS:
!B
!B 	PICK VIEW: Pick the view .
!B
!B	VIEW NAME: Input the name of the view.

stat=ChangeLabelStr("ScriptNameStatus","Function: apply named view ")

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

Vnum=PickView("PICK VIEW")
IF (ExitScript(Destination$)) THEN Leave

Stat=SetInputFormat("a99","",WsFalse)
stat= GetValue("VIEW NAME",Name$)
IF (ExitScript(Destination$)) THEN Leave

Sview= FindNamedView(Name$)

stat= ApplyNamedView(Vnum,Name$)

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