version 6.0
DR SAVE DOCUMENT (area; document; type; scope)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| document | Text | Name of document | |
| type | String | Type of document | |
| scope | Longint | 0=All objects | |
| 1=Selected objects |
Description
The command DR SAVE DOCUMENT saves the contents of area into document.
If document is an empty string, DR SAVE DOCUMENT displays the standard Save File dialog box, enabling the user to specify the document name, type, and scope. If document is not an empty string, DR SAVE DOCUMENT saves document with the type Type. If document does not exist, DR SAVE DOCUMENT creates it. If document exists, DR SAVE DOCUMENT overwrites it.
If type is an empty string, a standard 4D Draw document is created.
Three saving formats can be passed to type as a string; which can have three or four characters on either platform. The four-character format maintains compatibility with the old MacOS version.
The formats are:
4DW or 4DRW
PCT or PICT
PNT or PNTG
The optional scope parameter controls what is saved into document. Use scope only when document is not an empty string and when working with documents of type PICT and PNTG.
If scope equals 1, only selected objects are saved. If no objects are selected, the document is not saved, and DR Error returns error 37.
If scope equals 0, or if it is missing, all objects in area are saved.
By default, document is saved in the folder that contains the database structure. To save a document outside of the database folder, specify a complete pathname.
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".
If the document is already open, DR Error returns error code -49.
Example
The following example saves a drawing in a PICT document.
`On Windows: DR SAVE DOCUMENT (Area;"Logo.pct";"PCT";1) `On MacOS: DR SAVE DOCUMENT (Area;"Logo";"PICT";1)
See Also