Command PV OPEN DOCUMENT

4D View

PV OPEN DOCUMENT

version 6.8


PV OPEN DOCUMENT (area; document; template)

ParameterTypeDescription
areaLongint4D View area
documentStringDocument name
templateInteger0 = Document; 1 = Template

Description

The PV OPEN DOCUMENT command opens in area the requested document.

Pass in document the full path name of the document to open. If you pass an empty string ("") in this parameter, a standard open file dialog box appears and the user can select the document. If the user clicks Cancel in this case, no document will be opened.

The template parameter allows you to set whether the document should be opened as a standard document (template=0) or as a template (template=1).

When a document is opened as a template, a new document "Untitled" is actually created, containing a copy of the requested document. The original document remains intact.

If the value of template is 1, the document is opened as if it were a template regardless of its actual status (document or template), set by PV SAVE DOCUMENT.

Note: The "document" template mechanism is managed by the OS. It is different from the one used with 4D View "templates", attached to included areas (accessible using the Save as template menu command). For more information on area templates, refer to the 4D View User manual.

Example

Open a standard open file dialog box, applied to 4D View:

   PV OPEN DOCUMENT (Area;"";0)  `Document choice

See Also

PV SAVE DOCUMENT.

System Variables and Sets

The Document variable system contains either the name or the access path and the name of the last disk file opened (see the 4D Language Reference manual, System Variables section).

The system variable OK uses 1 as its value if the document was correctly opened.