Click or drag to resize

GetFile Function

X#
-- todo --
Displays the Open dialog box.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION GetFile(
	cFileExtensions,
	cText,
	cOpenButtonCaption,
	nButtonType,
	cTitleBarCaption
) AS STRING CLIPPER
Request Example View Source

Parameters

cFileExtensions (Optional)
Type: Usual
Specifies the file name extensions for the files to display in the Open dialog box when the All Files type is not chosen.
For more information on this, see the remarks section
cText (Optional)
Type: Usual
Specifies text to display for the File Name label in the Open dialog box.
cOpenButtonCaption (Optional)
Type: Usual
Specifies a caption for the OK button in the Open dialog box.
nButtonType (Optional)
Type: Usual
Specifies the number and type of buttons that appear in the Open dialog box. The table in the remarks section lists the values for nButtonType.
cTitleBarCaption (Optional)
Type: Usual
Specifies the caption for the title bar of the Open dialog box.

Return Value

Type: String
Character. GetFile( ) returns the name of the file chosen in the Open dialog box or the empty string if the user closes the Open dialog box by pressing Esc, clicking Cancel or the Close button on the Open dialog box.
Remarks
When passing a value as a literal, enclose it with quotation marks (""). Do not include a period (.) in front of file name extensions.
Note Note
The cFileExtensions parameter cannot exceed 254 characters in length.
cFileExtensions can take a variety of forms:
    nButtonTypeButtons isplayed
    0 (or omitted)OK, Cancel
    1OK, New, Cancel
    2OK, None, Cancel

    Note Note
    GetFile( ) returns the string "Untitled" with the path specified in the Open dialog box when nButtonType is set to 1 and the user clicks New, or when nButtonType is set to 2 and the user clicks None.
Examples
X#
 1Close Databases
 2Select 0
 3gcTable=GetFile('DBF', 'Browse or Create a .DBF:',
 4'Browse', 1, 'Browse or Create')
 5DO CASE
 6CASE 'Untitled' $ gcTable
 7Create (gcTable)
 8CASE EMPTY(gcTable)
 9RETURN
10OTHERWISE
11Use (gcTable)
12BROWSE
13ENDCASE
See Also