GefApplication.OpenEx (method)

Opens a screen file with various options.
Syntax: Set GefScreen = object.OpenEx ( OpenType, FileName, Project, Visible, ParentScreen, ObjectToEdit, VariableValues )
Parameters:
OpenType As GefOpenTypeEnum - The type of open to perform.
FileName As String - The name of the screen to open. If this is a relative pathname, it is qualified by the DefaultFilePath.
Project As String - If specified, determines the project used to qualify unqualified point IDs in the screen.
Visible As Boolean - If specified as False, the screen will be opened but will not be displayed. Use the Visible property of the GefScreen to change the visibility. The default is True.
ParentScreen As GefScreen - The screen that this new screen will be captive to. No input will be allowed in the parent screen until the new screen is closed. This is used only for the modal open types: gefOpenTypeModalChild and gefOpenTypeModalDialog. You may specify an object set to Nothing if it is not needed.
ObjectToEdit As GefObject - If specified, this is the object that is being "edited" by the new screen. "Edited" means that it will receive the values from the public variables on the screen object. This is used only for the gefOpenTypeModalDialog open type. You may specify an object set to Nothing if it is not needed.
VariableValues As VARIANT - A CoCimSafeArray3 array of initial variable values for the newly opened screen. (Note: In VBScript and VBA/VB, you can use a native array of strings.)
Description: For dialog windows, the object that is being edited is defined as GefScreen.ObjectToEdit on the popup screen. The variables on the ObjectToEdit will be exchanged with the public variables on the screen. If the ObjectToEdit parameter is missing then no values will be brought back to the parent screen. Note: GefScreen.CloseEx must be used to close dialog windows.

The VariableValues parameter is a String array containing the initial values of variables in the new screen. If NVARS is the number of variables, the array should be dimensioned as

    Dim initVars as CoCimSafeArray2
    Set initVars = CreateObject("CIMPLICITY.CimSafeArray.2")
    cimsafe.CreateVector cimVString, 0, 2*NVARS

or

    Dim initVars(0 To 2*NVARS-1) as String

where initVars.Element(0) is the name of first variable and initVars.Element(1) is the value of the first variable.

This array may also be dimensioned as

    Dim initVars(0 To 1, 0 To NVARS-1) as String

in which case initVars(0,0) is the name of the first variable and initVars(1,0) is the value of the first variable.

Example:

Sub Application_OpenEx(bModalDialog)
  Dim initVars As CoCimSafeArray2
  Set initVars = CreateObject("CIMPLICITY.CimSafeArray.2")
  initVars.CreateVector cimVString, 0, 6
  initVars.SetVectorElement 0, "\textobj\var"
  initVars.SetVectorElement 1, """sample text"""
  initVars.SetVectorElement 2, "screenvar"
  initVars.SetVectorElement 3, "1717"
  initVars.SetVectorElement 4, "varname3"
  initVars.SetVectorElement 5, "varvalue3"
  Dim myscreen As GefScreen
  Dim noObj As Object
  Set noObj = Nothing
  If (bModalDialog) Then
    Set myscreen = CimGetScreen.Application.OpenEx(gefOpenTypeModalDialog, _
      "screen2.cim", "PROJ1", True, CimGetScreen, CimGetObject, initvars)
  Else
    Set myscreen = CimGetScreen.Application.OpenEx(gefOpenTypeNormal, _
      "screen2.cim", "PROJ1", True, noObj, noObj, initvars)
  End If
End Sub