| Parameter | Description |
|---|---|
| sWorkspaceFile | Name of the Workspace file |
A constant (described below) indicating success or failure
Function OpenWorkspaceFile String sWorkspaceFile Returns Integer
| Call: | Get OpenWorkspaceFile sWorkspaceFile to IntegerVariable |
The OpenWorkspaceFile function opens a Workspace by directly reading the file that describes it. If you want to open a Workspace that is registered, use OpenWorkspace instead.
The name of the Workspace file can optionally contain its extension (*.ws) and it can be qualified or non-qualified. If the name is non-qualified, then the class will look in the directory that the program started in for the file; if the name is qualified (that is, it contains a path in addition to a name), then it will look in that path for the file.
The return value is one of the following constants:
| Constant | Meaning |
|---|---|
| wsWorkspaceOpened | The Workspace was opened ok |
| wsWorkspaceFileNotFound | The file describing the Workspace(*.WS) was not found |
| wsDataPathEmpty | The DataPath entry was empty |
| wsFileListEmpty | The FileList entry was empty |
| wsFileListNotExist | The FileList.cfg file could not be found |
Object oApplication is a cApplication
Procedure OnCreate
Handle hoWorkspace
Integer eOpened
String sError
Get phoWorkspace To hoWorkspace
Get OpenWorkspaceFile of hoWorkspace "ABC, Inc.Accounts" To eOpened
If (eOpened <> wsWorkspaceOpened) Begin
Get OpenWorkspaceErrorMessage of hoWorkspace eOpened To sError
Send Stop_Box sError "Error Opening Workspace"
Abort
End
End_Procedure // OnCreate
End_Object // oApplication