
! script name: vcontrol.d/openobject
! var_topic: open variational object

!A
!A NAME:
!A
!A 	Open Variational Object
!A
!A DESCRIPTION:
!A
!A	This script will open an existing variational object. New Variational
!A	records will be placed in this object until the object is closed
!A	or the variational program is executed by either execute all
!A	or a edit which only executes a part of the program.
!A
!B INSTRUCTIONS:
!B
!B 	PICK VARIATIONAL OBJECT,   New object: Select object to be opened.
!B
!B 	OBJECT NAME: Enter the VDM object name of the new object.
!B
!B 	INVALID OBJECT NAME, Proceed:
!B
!# see also - htdocs/help.d/vdminfo.htm

Stat=ChangeLabelStr("ScriptNameStatus","Function: open variational object")

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

DeActivateUndo
Highlight_color=2

Pick_object:!
Var_object=PickVarObject("SELECT EXISTING OBJECT TO BE OPENED")
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Var_object) THEN Pick_object
Stat=VarObjectName(Var_object,Name$)

DelCurrObjPaths
CurrentObjectPaths
Var_object=OpenVarObject(Name$)
Stat=Highlight(Var_object,Highlight_color,0)

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