Skip to content

DoOpenWorkspace - cApplication

Opens a Workspace

Type: Procedure

Parameters

Parameter Type Description
sWorkspace String Name of the Workspace

Syntax

Procedure DoOpenWorkspace String sWorkspace

Call Example

Send DoOpenWorkspace sWorkspace

Description

You can use the DoOpenWorkspace procedure inside OnCreate to open a specific Workspace.

This is the order that is used to open the Workspace:

  1. If the Workspace name contains a path, then that path is used; otherwise,
  2. If the Workspace file is in the same directory that the program is running in, it is used; otherwise,
  3. If it is registered, the path the Workspace file is located via its registered location.

If there is an error in opening the Workspace, an error will be generated giving a detailed reason for the failure, and the program will abort.

Use cApplication.pkg

Object oApplication is a cApplication
    Set psCompany To "Data Access Worldwide"
    Set psProduct To "DataFlex 12.0 Examples"
    Set psVersion To "12.0"
    Set psProgram To "Order"

    Procedure OnCreate
        Send DoOpenWorkspace "Order Entry"
    End_Procedure

End_Object // oApplication
Col 1 Col 2
Note: In applications that only use a single Workspace and are expected to work without problems, this procedure is fine. However, for programs that need to switch Workspaces or validate Workspaces, etc., a more flexible alternative is to use cWorkspace's OpenWorkspace or OpenWorkspaceFile.

See Also

cWorkspace | OpenWorkspace | OpenWorkspaceFile