Microsoft KB Archive/98748

= How to Use the GETDIR Function in FoxPro 2.5 and Later =

Article ID: 98748

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b for MS-DOS
 * Microsoft FoxPro 2.5a
 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



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(&quot;C:\WINDOWS&quot;, &quot;SELECT A DIRECTORY&quot;) 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.

