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



The information in this article applies to:

  • Microsoft FoxPro for Windows 2.5
  • Microsoft FoxPro for Windows 2.5a
  • Microsoft FoxPro for MS-DOS 2.5
  • Microsoft FoxPro for MS-DOS 2.5a
  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a
  • Microsoft Visual FoxPro for Windows 6.0

This article was previously published under Q98748

SUMMARY

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.

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:KB98748