4D v13.4

MAP FILE TYPES

Home

 
4D v13.4
MAP FILE TYPES

MAP FILE TYPES 


 

MAP FILE TYPES ( macOS ; windows ; context ) 
Parameter Type   Description
macOS  String in Mac OS file type (4-character string)
windows  String in Windows file extension
context  String in String displayed in List of Types drop-down list of the Windows file dialog boxes

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 Create document, Append document, 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 X-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

 
PROPERTIES 

Product: 4D
Theme: System Documents
Number: 366

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

Append document
Create document
Open resource file