Important: The information in this document is obsolete and should not be used for new development.
StandardGetFile
You can use the StandardGetFile procedure to display the default Open dialog box when the user is opening a file.
PROCEDURE StandardGetFile (fileFilter: FileFilterProcPtr; numTypes: Integer; typeList: SFTypeList; VAR reply: StandardFileReply);
fileFilter- A pointer to an optional file filter function, provided by your application, through which
StandardGetFilepasses files of the specified types.numTypes- The number of file types to be displayed. If you specify a
numTypesvalue of -1, the first filtering passes files of all types.typeList- A list of file types to be displayed.
reply- The reply record, which
StandardGetFilefills in before returning.DESCRIPTION
TheStandardGetFileprocedure presents a dialog box through which the user specifies the name and location of a file to be opened. While the dialog box is active,StandardGetFilegets and handles events until the user completes the interaction, either by selecting a file to open or by canceling the operation.StandardGetFilereturns the user's input in a record of typeStandardFileReply.The
fileFilter,numTypes, andtypeListparameters together determine which files appear in the displayed list. The first filtering is by file type, which you specify in thenumTypesandtypeListparameters. ThenumTypesparameter specifies the number of file types to be displayed. You can specify one or more types. If you specify anumTypesvalue of -1, the first filtering passes files of all types.The
fileFilterparameter points to an optional file filter function, provided by your application, through whichStandardGetFilepasses files of the specified types. See the chapter "Standard File Package" in this book for a complete description of how you specify this filter function.SPECIAL CONSIDERATIONS
TheStandardGetFileprocedure is not available in all versions of system software. Use theGestaltfunction to determine whetherStandardGetFileis available before calling it.Because
StandardGetFilemay move memory, you should not call it at interrupt time.