How to Return Entire MS-DOS Path from PROMPT FILES List

Last reviewed: March 16, 1996
Article ID: Q97642
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6x
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6x
  • Microsoft FoxPro for Macintosh, versions 2.5x, 2.6a
  • Microsoft FoxPro for UNIX, version 2.6

SUMMARY

When you create a list popup in FoxPro using the PROMPT FILES clause, the entire path is not stored in the variable.

MORE INFORMATION

To have the entire path returned, do the following:

  1. In the setup code of the screen, define a popup with the PROMPT FILES clause. For example:

          DEFINE POPUP popfile PROMPT FILES LIKE *.dbf
    

  2. In the setup code, define as character the variable that the list will be using. Also, define a character variable to which the entire path will be stored. For example:

          var=''     && List variable
          entire=''  && Variable for entire path
    
    

  3. To create the list, do one of the following, depending on which platform you are using:

        - In FoxPro for MS-DOS, position the cursor on the screen in the
          place where you want the list to appear. From the Screen menu,
          choose List, select From Popup, and type "popfile" (without the
          quotation marks) as the popup name. In the Variable box, type
          "var" (without the quotation marks).
    

        - In FoxPro for Windows, click the list tool, then click in the
          Screen Design window where you want the list to appear and drag
          the list to the desired size. The List dialog box will open. In
          the dialog box, select From Popup, and type "popfile" (without
          the quotation marks) as the popup name. In the Variable box,
          type "var" (without the quotation marks).
    

  4. In the Valid procedure, type the following code:

          entire=PRMBAR("popfile", 2)+var
    

  5. The variable called "entire" now contains the entire path to the selected file, as well as the filename. To verify this, include the following statement after the command given in step 4:

          WAIT WINDOW entire
    


Additional reference words: FoxDos FoxWin FoxMac FoxUnix 2.00 2.50 2.50a
2.50b 2.60 2.60a pop-up fullpath full-path
KBCategory: kbprg
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.