How to Use the GETDIR() Function in FoxPro 2.5 and Later

ID: Q98748

2.50 2.50a | 2.50 2.50a

WINDOWS    | MS-DOS
kbprg

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a
  • Microsoft FoxPro for MS-DOS, versions 2.5, and 2.5a
  • Microsoft Visual Foxpro, versions 3.0, 3.0b, 5.0, 5,0a, 6.0

The GETDIR() function can be used in FoxPro to display the FoxPro Select Directory dialog box. This function is not available in versions of FoxPro prior to version 2.5.

The GETDIR() function accepts 0, 1, or 2 character strings as arguments and returns the name of the chosen directory as a character string in the dialog box.

The following example uses the GETDIR() function to display the Select Directory dialog box with the C:\WINDOWS directory initially selected:

   mdir = GETDIR("C:\WINDOWS", "SELECT A DIRECTORY")

NOTE: The limit of the text string is related to the proportional size of the system font.

For instance, in the following text, note that since the text is uppercase, only the first 12 characters display and the string truncates after the word 'FIRST':

   SELECT THE FIRST SUBDIRECTORY.

However, in the following text, note that about 26 characters display and that the string truncates following the '-'.

   Select the first subdirectory - which compares.

REFERENCES

For more information about the proper syntax for the GETDIR() function, please see the "Language Reference" manual or the FoxPro online Help file.

Additional reference words: FoxDos FoxWin 2.50 2.50a kbvfp300 kbvfp300b kbvfp500 kbvfp500a kbvfp600 KBCategory: kbprg KBSubcategory: FxprgGeneral Version : WINDOWS: 3.0,3.0b,5.0,5.0a,6.0


Last Reviewed: August 13, 1998
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.