version 6.0
DR OPEN DOCUMENT (area; document; mode)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| document | String | Name of document, | |
| 255 chars maximum | |||
| mode | Integer | 0=Replace | |
| 1=Combine |
Description
The command DR OPEN DOCUMENT opens document and places its contents into area. The document must be of type 4D Draw (*.4dw on Windows), PICT (*.pct on Windows), EPSF (*.eps on Windows) or MacPaint PNTG (*.pnt on Windows). If document is an empty string, DR OPEN DOCUMENT displays the standard Open File dialog box, enabling the user to choose the document. If document does not exist, the contents of area remain unchanged and DR Error returns a system error code. If the document is already open, DR Error returns error code 43.
4D Draw expects to find document in the folder that contains the database structure. If you want to open a document outside of the database folder, specify a complete pathname. If document is already open, DR Error returns a Macintosh system error.
Windows: Enter the letter of the disk plus a colon (":") and then a "\" between each folder. The file name must have an extension to determine its type, for example: "D:\Folder1\Folder2\File.PCT".
MacOS: Enter the name of the disk and a ":" between each folder, for example: "Hard Disk:Folder:Document".
The optional mode parameter controls how the document is opened. mode is used only when document is not an empty string and is recognized only for documents of type PICT, PNTG, and EPSF.
If mode equals 0 or is not specified, document replaces the contents of area.
If mode equals 1, document is combined with the current contents of area.
Example
This example opens a different drawing based on the value of the Client Type field.
Case of : ([Client]Client Type="Distrib.4DW") `If the type is Distrib.4DW DR OPEN DOCUMENT (Area;"Distrib.4DW") `Open the Distrib.4DW drawing : ([Client]Client Type="Construc.4DW") `If the type is Construc.4DW DR OPEN DOCUMENT (Area;"Construc.4DW") `Open Construc.4DW drawing : ([Client]Client Type="Client.4DW") `If the type is Client.4DW DR OPEN DOCUMENT (Area;"Client.4DW") `Open the Client.4DW drawing End case
See Also