MAP FILE TYPES

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3.5


MAP FILE TYPES (macOS; windows; context)

ParameterTypeDescription
macOSStringMac OS file type (4-character string)
windowsStringWindows file extension (1 to 3-character string)
contextStringString displayed in List of Types drop-down list
of the Windows file dialog boxes

Description

MAP FILE TYPES lets you associate a Windows file extension with a Macintosh file type.

You need to call this routine only once to establish a mapping for an entire worksession with a database. Once the call has been made, the commands Append document, Create document, Create resource file, Open resource file and Open resource file while running on Windows will automatically substitute the Windows file extension for the Macintosh file type you actually pass as a parameter to the routine.

In the macOS parameter you pass a 4-character Macintosh file type. If you do not pass a 4-character string, the command does nothing and generates an error.

In the windows parameter you pass a 1 to 3-character Windows file extension. If you do not pass a 1 to 3-character string, the command does nothing and generates an error.

In the context parameter you pass the string that will be displayed in the List Files of Type drop-down list of the Windows Open File dialog box. The context string is limited to 32 characters; additional characters are ignored.

IMPORTANT: Once you have mapped a Windows file extension to a Macintosh file type, you cannot change or delete this mapping within a single work session. If you need to change a mapping while developing and debugging a 4D application, reopen the database and remap the file extension.

Example

The following line of 4D code (that could be part of the Startup database method) maps the Macintosh MS-Word file type "WDBN" to the Windows file extension ".DOC":

   MAP FILE TYPES ("WDBN";"DOC";"Word documents")

Once the call above has been made, the following code will display only Word documents in the Open file dialog on Windows and Macintosh:

   $DocRef:=Open document("";"WDBN")
   If (OK=1) 
      ` ... 
   End if

See Also

Append document, Create document, Create resource file, Open resource file.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next