Microsoft KB Archive/94342

= Alternative to List Prompt Files Option in .SCX =

Article ID: 94342

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.0

-



This article was previously published under Q94342



SUMMARY
In the Screen Builder, selecting the Prompt Files option in the List dialog box (on the Screen menu) produces a list object of files and directories from a given path. You can select from this list as well as change to other directories or drives.

To display only a list of files in a specific directory, use the function ADIR and the From Array option instead. Using this option also prevents you from changing to other directories or drives.



FoxPro 2.x for Windows
To get a list object of .DBF files in the TUTORIAL subdirectory, do the following:   Open the appropriate .SCX file, and include the code below in the Setup code snippet: =ADIR(MYLIST,&quot;C:\FOXPRO2\TUTORIAL\*.DBF&quot;)  Place the cursor on the .SCX form. From the Screen menu, choose List, and select the From Array option. Use &quot;MYLIST&quot; as the array name. Assign a variable name to this list object; call it DBFLIST . From the Program menu, choose Generate.

Visual FoxPro for Windows
 Add a property called mylist(1) to the form.  In the Load event, add the following lines of code: DIMENSION THISFORM.mylist(1) =ADIR(THISFORM.mylist,&quot;c:\vfp\samples\data\*.dbf&quot;) </li> For the listbox, change the RowSourceType to 5-Array, and then change the RowSource to THISFORM.mylist .</li></ol>

NOTE: The arguments used with the ADIR function directly affect file searches.

For more information about the arguments used with the ADIR function, see the version 2.0 &quot;Commands & Functions&quot; manual or the version 2.5 &quot;Language Reference&quot; manual.

Additional query words: VFoxWin FoxDos FoxWin 2.50 2.50a 2.50b 2.60 2.60a

Keywords: KB94342

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.