[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| PUTFILE |
+---------------------------------+
PUTFILE([<expC1>] [, <expC2>]
[, <expC3>])
-----------------------------------
Displays Save As dialog.
Return value - Character
-----------------------------------
PUTFILE() displays the FoxPro Save As dialog, allowing you to name a
file and save it on disk. PUTFILE() returns the file name with its
fully qualified path. If a file name is not entered, the default file
name (specified by <expC2>) and extension (specified by <expC3>) are
returned. If the Cancel push button is chosen or Escape pressed,
PUTFILE() returns the null string.
<expC1>
<expC1> is the prompt displayed at the top of the Save As dialog.
<expC2>
<expC2> is the default file name displayed in the text box.
<expC3>
<expC3> specifies the extensions of the files displayed in the Save As
dialog's scrollable list when the All Files check box is not checked.
For a complete list of the file extensions used by FoxPro, see the file
extension table in the FoxPro Developer's Guide. The first extension in
<expC3> is automatically appended to the file name if an extension is
not included with the file name.
The file extension <expC3> can take a variety of forms:
. <expC3> can contain a single extension (for example, 'PRG'), and only
files that have that extension are displayed.
. <expC3> can contain a list of file extensions separated by semicolons
(for example, 'PRG;FXP'). In this example, PUTFILE() displays all files
with the extensions PRG and FXP.
However, if files have the same name but different extensions (for
example, CUSTOMER.PRG and CUSTOMER.FXP), only the file with the first
extension in the file extension list is displayed. In this example, if
the file extension list contains 'PRG;FXP', only CUSTOMER.PRG is in the
list, but CUSTOMER.FXP is not.
. <expC3> can contain a list of file extensions separated by vertical
bars (for example, 'PRG|FXP'). In this case, all files with the listed
extensions are displayed, even if the files have the same names.
. If <expC3> contains a single semicolon (';'), all files without an
extension are displayed in the scrollable list.
. If <expC3> is the null string, all files in the current directory are
displayed.
. <expC3> can also contain DOS wildcard characters (* and ?). All
files with extensions that meet the wildcard criteria are displayed.
For example, if <expC3> is '?X?', all files with the extensions FXP,
EXE, TXT and so on are displayed.
+---------------------------------+
| Program Example |
+---------------------------------+
This example can be used to create a delimited data file from any
existing database. GETFILE() allows you to find and open a file, and
PUTFILE() returns the name of the output file you wish to create.
dbf_file = GETFILE('DBF', 'Open Database:')
USE (dbf_file)
file_name = ALIAS()
out_file = PUTFILE('Delimited file:', file_name, 'DLM')
IF EMPTY(out_file) && Escape pressed
CANCEL
ENDIF
COPY TO (out_file) DELIMITED && Create delimited file
MODIFY FILE (out_file) NOEDIT
-----------------------------------
See Also: GETEXPR, GETFILE(), LOCFILE()
-----------------------------------
See Also:
GETEXPR
GETFILE()
LOCFILE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson