4D Chart v13

CT OPEN DOCUMENT

Home

 
4D Chart v13
CT OPEN DOCUMENT

CT OPEN DOCUMENT 


 

CT OPEN DOCUMENT ( area ; document ; mode ) 
Parameter Type   Description
area  Longint in 4D Chart area
document  String in Name of the document, with path 255 characters maximum
mode  Integer in Replace document or append to document 0 = Replace 1 = Append to document

The CT OPEN DOCUMENT command opens document and places its contents into area.

If document is an empty string, CT OPEN DOCUMENT displays a standard open-file dialog box, enabling the user to choose the document.

Otherwise, it attempts to open the specified document. If document does not exist, the contents of area remain unchanged and CT Error returns a system error code.

4D Chart expects to find document in the directory that contains the database structure. If you want to open a document outside this directory, specify a complete pathname. See the 4D Language Reference manual for a brief description of pathnames. If document is already open, CT Error returns a system error.

The optional mode parameter controls how the document is opened. mode is used only when document is not an empty string and is not a 4D Chart document. 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 document based on the value of the Client Type field.

 Case of
  `If the type is Distributor
    :([Client]Client Type="Distributor")
  `Open the document
       CT OPEN DOCUMENT(Area;"Distributor")
  `If the type is Constructor
    :([Client]Client Type="Constructor")
  `Open the Constructor document
       CT OPEN DOCUMENT(Area;"Constructor")
  `If the type is FinalClient
    :([Client]Client Type="FinalClient")
  `Open this document
       CT OPEN DOCUMENT(Area;"FinalClient")
 End case

 
PROPERTIES 

Product: 4D Chart
Theme: CT Area
Number: 14501

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Chart 1

 
SEE ALSO 

CT SAVE DOCUMENT