8 |
The LA Fox Developer Newsletter
January 1995
Pick a Project...
[Con't from page 7]
made to DEV, including a field to store the name
of the FoxPro project (.PJX) file for the project so
that DEV.PRG automatically could open the
project for me. I’ll “get around” to making some
enhancements to DEV “one of these days.” But, in
the mean time, I’m finding it very useful. I hope you
might too. The source code and a sample .DBF
are available on the MFPUG BBS (816/525-3699).
Figure 1
-
DEV.DBF structure
Field
Field Name
Type Width Dec Index
Collate
1
DE_PROJ
Char
40
2
DE_CLIENT
Char
30
3
DE_PATH
Char
40
4
DE_SETLJP
Char
20
Figure 2- DEV.PRG
DEV.PRG
Kelly G. Conway
9/19/94
This program is meant to be
used
as the startup
program for FoxPro.
It presents a
list
of development projects (from
DEV.DBF) and allows a choice of one. If {Esc} is
pressed, no project is chosen. If a project is
chosen, the default is set to its path and its
setup
program (if any is specified in DEV.DBF) is
executed.
private all like
clear
set talk off
set path to \dev
Create an array of development projects for the
pick list.
The array created matches the structure of
DEV.DBF (see above) so that element [i,1] is
the poject name, [i,2] is the cteint name, [i,3]
-
is
the DOS path to the project and [i,4] is the
-
name of the setup program to run
(including
-
the relative path if it
is in a
subdirectory
of the
-
main project directory.
select
from dev;
order by de_proj
into array LDev
If we don’t have any project records, just exit now.
if_tally
=
0
return
endif
Change the FoxPro window to use a readable
font. Also change the main FoxPro window title
while we’re at it.
modify window screen font “MS Sans Serif, 10
title “PBSI FoxPro Development”
Popup a list of the project records and allow selection.
?? chr(7) && Sound the bell
I_Choice
=
1 && Prime the list to
start
on the 1st project
@
6,24 say “Select a project to work on
or
press {Esc}"
8,25 get LChoice from l_Dev
read
close databases
• If didn’t press {Esc}, set default to project directory
• and run the project setup program (if one is
• specified in
DEV.DBF).
if lastkeyØ #27
I_path
=
alltnm(l_Dev[I_choice,
3])
I_setup
=
alltnm(I_Dev[l_choice, 4])
change to the project directory
if !empty(I_path)
set default to (I_path)
endif
Run the project’s setup program
if !empty(I_setup)
do (I_setup)
?? chr(7)
wait window “Default set to”
+
I_path +;
and
“+
I_setup
+
•
has
been executed."
nowait
else
wait window “Default set to”
+
I_path
+“.
nowait
endif
return
Page 8
|
8 |