CT OPEN DOCUMENT

4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next

version 1


CT OPEN DOCUMENT (area; document{; mode})

ParameterTypeDescription
areaLongint4D Chart area
documentStringName of the document, with path
255 characters maximum
modeIntegerReplace document or append to document
0 = Replace
1 = Append to document

Description

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 4th Dimension 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

See Also

CT SAVE DOCUMENT.


4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next