GETFILE( ) Function

Example   See Also

Displays the Open dialog box and returns the name of the file you chose.

Syntax

GETFILE([cFileExtensions] [, cText] [, cOpenButtonCaption]
  [, nButtonType] [, cTitleBarCaption])

Returns

Character

Arguments

cFileExtensions

Specifies the file extensions of the files displayed in the scrollable list when the All Files menu item isn't chosen. If passing a value as a literal, enclose it in quotation marks. Do not include a period (.) in front of file extensions.

cFileExtensions can take a variety of forms:

cText

Specifies the text for the directory list in the Open dialog box. In Windows 95, the text appears below the list of files and long text strings may be truncated.

cOpenButtonCaption

Specifies a caption for the OK button.

nButtonType

Specifies the number and type of buttons that appear in the Open dialog box. The following buttons appear in the dialog box when nButtonType is 0, 1, or 2.

nButtonType Buttons
0
(or omitted)
OK
Cancel
1 OK
New
Cancel
2 OK
None
Cancel

"Untitled" is returned with the path specified in the Open dialog box if nButtonType is 1 and the user chooses the New button. The empty string is returned if nButtonType is 2 and the user chooses the None button.

cTitleBarCaption

Specifies the title bar caption.

Remarks

GETFILE( ) returns the empty string if you exit the Open dialog box by pressing ESC, choosing Cancel, or choosing Close from the Control menu.