open(): Integer updating;
The open method of the CMDFileOpen class initiates the common File Open dialog and returns a value indicating the success of the user actions, as listed in the following table.
Value | Description |
---|---|
0 | User clicked the OK button. Values of the selections made are returned. |
1 | User clicked the Cancel button. |
Other | Windows error number indicating a fault associated with the execution of the dialog. |
The position of the common File Open dialog cannot be determined. The values of the variable options for the class should be set before the open method is used.
The following example shows the use of the open method to open a common File Open dialog.
vars fopen : CMDFileOpen; begin create fopen; fopen.initDir := app.dbPath; // set the initial directory if fopen.open = 0 then // not cancelled and no error self.name := fopen.fileTitle; // use the returned value endif; epilog delete fopen; // tidy end;
Any values that are returned are retained if further calls are made on the class instance. The object should be deleted when it is no longer required.
An exception is raised if this method is invoked from a server method.