Alternative to List Prompt Files Option in .SCX
ID: Q94342
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, version 3.0
-
Microsoft FoxPro for Windows, versions 2.5x, 2.6x
-
Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6x
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.
MORE INFORMATIONFoxPro 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,"C:\FOXPRO2\TUTORIAL\*.DBF")
- Place the cursor on the .SCX form. From the Screen menu, choose
List, and select the From Array option. Use "MYLIST" 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,"c:\vfp\samples\data\*.dbf")
- For the listbox, change the RowSourceType to 5-Array, and then change
the RowSource to THISFORM.mylist.
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 "Commands & Functions" manual or the
version 2.5 "Language Reference" manual.
Additional query words:
VFoxWin FoxDos FoxWin 2.50 2.50a 2.50b 2.60 2.60a
Keywords : FxtoolFormdes
Version : MS-DOS:2.0,2.5x,2.6x; WINDOWS:2.5x,2.6x,3.0
Platform : MS-DOS WINDOWS
Issue type :
|