[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             GETFILE             |
+---------------------------------+
GETFILE([<expC1>] [, <expC2>])

-----------------------------------
Displays Open File dialog.
Return value - Character
-----------------------------------

The GETFILE() function displays the FoxPro Open File dialog from which a
file anywhere on disk can be chosen.  GETFILE() returns the name of the
chosen file.  If a file is not chosen (Cancel is chosen or Esc is
pressed), GETFILE() returns the null string.

<expC1>
        The optional character expression <expC1> specifies the extensions of
the files displayed in the Open File 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 this help
facility or in the FoxPro Developer's Guide.

        The file extension expression <expC1> can take a variety of forms:

        . <expC1> can contain a single extension (for example, 'PRG'), and only
files that have that extension are displayed.

        . <expC1> can contain a list of file extensions separated by semicolons
(for example, 'PRG;FXP').  In this example, GETFILE() 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', just the CUSTOMER.PRG file
is displayed.

        . <expC1> can contain a list of file extensions separated by vertical
bars (for example, 'PRG|FXP').  In this case, ALL files with these
extensions are displayed, even if the files have the same names.

        . If <expC1> contains just one semicolon (';'), all files without an
extension are displayed in the scrollable list.

        . If <expC1> is the null string, all files in the current directory are
displayed.

        . <expC1> can also contain DOS wildcard characters (* and ?).  All
files with extensions that meet the wildcard criteria are displayed.
For example, if <expC1> is '?X?', all files with the extensions FXP,
EXE, TXT and so on are displayed.

<expC2>
        The optional argument <expC2> is the prompt that will be displayed at
the top of the Open File dialog.

+---------------------------------+
|         Program Example         |
+---------------------------------+
SELECT 0
dbf_file = GETFILE('DBF', 'Open Database:')
USE (dbf_file)

idx_file = GETFILE('CDX|IDX|NDX', 'Index:')
SET INDEX TO (idx_file)
USE

-----------------------------------

See Also:  GETEXPR, LOCFILE(), PUTFILE()

-----------------------------------

See Also: GETEXPR LOCFILE() PUTFILE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson