FileType$()

Syntax

FileType$(File$)

Remarks

On the Macintosh, returns a four-character string identifying the file type of File$ (a path and filename). In Windows, FileType$() is not available and generates an error.

Example

This Macintosh example displays a message box stating the file type of the file specified by checkfile$:


checkfile$ = "HD:WORK:TO DO LIST"
ftype$ = FileType$(checkfile$)
Select Case ftype$
    Case "W6BN" : a$ = "a Word document"
    Case "WDBN" : a$ = "a Word 5.1 document"
    Case "WTBN" : a$ = "a Word template"
    Case "TEXT" : a$ = "a text file"
    Case "XLS5" : a$ = "a Microsoft Excel worksheet"
    Case "APPL" : a$ = "an application"
    Case "WDLL" : a$ = "a Word add-in library"
    Case "WIZ!" : a$ = "a wizard"
    Case Else : a$ = ""
End Select
If a$ <> "" Then
    MsgBox checkfile$ + " is " + a$ + "."
Else
    MsgBox checkfile$ + " has file type " + ftype$ "."
End If

See Also

FileCreator$(), MacID$(), SetFileCreatorAndType