Click or drag to resize

PutFile Function

X#
-- todo --
Invokes the Save As dialog box and returns the file name you specify.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION PutFile(
	cCustomText,
	cFileName,
	cFileExtensions
) AS STRING CLIPPER
Request Example View Source

Parameters

cCustomText (Optional)
Type: Usual
Specifies custom text to appear in the Save As dialog box.
cFileName (Optional)
Type: Usual
Specifies the default file name displayed in the text box.
cFileExtensions (Optional)
Type: Usual
Specifies file name extensions. Only file names with the specified extension are displayed in the scrollable list of the Save As dialog box when the All Files check box is cleared. The first extension in cFileExtensions is automatically appended to the file name entered if an extension isn't included with the file name. The cFileExtensions parameter cannot exceed 254 characters in length. For a list of X# file extensions and corresponding creator types, see the File Extensions and File Types online topic.
The character expression cFileExtensions can take one of the following forms:

    Return Value

    Type: String
    Character
    Remarks
    Use PutFile( ) to choose an existing file name or specify a new file name. PutFile( ) returns the file name with its path. If you don't enter a file name, PutFile( ) returns the default file name (specified with cFileName) and extension (specified by cFileExtensions). If you choose Cancel or press Esc, PutFile( ) returns an empty string. You can use the file name that PutFile( ) returns to name a file and save it to disk.
    Examples
    X#
    1gcTableName = GetFile('DBF', 'Open Table:')
    2Use (gcTableName)
    3gcDelimName = Alias( ) + '.DLM'
    4gcDelimFile = PutFile('Delimited file:', gcDelimName, 'DLM')
    5IF EMPTY(gcDelimFile)  // Esc pressed
    6CANCEL
    7ENDIF
    8COPY TO (gcDelimFile) DELIMITED   // Create delimited file
    9MODIFY FILE (gcDelimFile) NOEDIT
    See Also