home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DATABASE
/
FPEDFN2.ZIP
/
UTIL.DOC
< prev
Wrap
Text File
|
1992-02-05
|
16KB
|
493 lines
FoxPro Editor Enhancements
by
Fred Wampler
Ph (615)247-6674
The FoxPro editor enhancements become available once the program is started
by typing:
DO UTIL
Locate UTIL.APP somewhere on your FoxPro 2 path so that it is available to
all subdirectories.
A description for the menu items shown in Figure 1 follows:
Top
Go to first line in edit file.
Bottom
Go to last line in edit file.
Find
Same as ^F (search)
Refind
Same as ^G (search again)
Locate Procedure
See Figure 3. Locates procedures, functions or lines starting with *-.
Wrap around must be set on in the search (^F) window. The program works by
reading your backup file. All procedures, functions and lines beginning
with *- are put into an array for selection. The selected item is stuffed
into the search window (^F) and a search is made. Items may be selected
from the list by pressing <Enter> or double clicking the mouse. The
selection process can be aborted by pressing <Esc>. An array is saved and
available for each file you are editing (so long as FoxPro is not
terminated) and you may switch amoung them as needed. This eliminates
rebuilding the array each time you switch edit files. When a procedure,
function or line starting with *- is added to your edit file, the array
can be rebuilt using the RELOAD AND LOCATE function. The edit file must be
saved (twice) so that the backup is current before using the RELOAD
function.
Reload and locate
See locate procedure above.
Open file
Prg
Allows you to select or open a new file for editing.
Project
Allows you to select and open a project.
Menu
Allows you to create or select and open a menu.
Screen
Allows you to create or select and open a screen.
Report
Allows you to create or select and open a report.
Query
Allows you to create or select and open a query.
DBF
Allows you to open a DBF.
View
Allows you to open the view window.
Directory
Not avail.
Macros
IF Statement
Inserts IF-ENDIF into edit file.
DO CASE
Inserts DO CASE CASE ENDCASE into edit file.
DO WHILE LOOP
Inserts DO WHILE ENDDO into edit file.
FOR LOOP
Inserts FOR ENDFOR into edit file.
SCAN
Insert SCAN ENDSCAN into edit file.
Header
Inserts header information into edit file.
* Program.:
* Author..:
* Date....:
* Notice..:
* Notes...:
Date
Inserts date into file.
Marker
Inserts marker *- plus date into file
Tools
FoxGen Menu Generator
Generates menu fragments and places into file frag.pop
PopGen
Generates menu fragments.
PadGen
Generates menu fragments.
Browse Window Layout
Builds a code fragment in file window.txt containing the browse window
coordinates and fields for databases open in work areas. I use this by
opening the databases of interest in the view window. I size the
browse windows and then call this option. The browse windows are sized
based on the open browses. All fields are included along with default
field headings. Much typing is saved. See Figure 4.
Code to open DBF (Generator)
Used to write code to relat.txt for opening databases and setting
relations. Use the view window to open the databases and index files
and set relations. Open the databases receiving the relation in the
lower numbered work areas. Conversely, open the databases setting the
relations in higher numbered work areas. See Figure 5. Call this
option to write the code.
SetColor
Pick stored colorsets for objects such as menus, browse windows, etc.
Press <Enter> to accept or <Esc>
Helper
Popup over running programs to provide all sorts of helpful
information. See Figure 6.
DBF Stru
Display the database structure in a window. Double-click or press
enter to insert into the edit program.
Cancel
Cancel program.
FCLOSE() ALL
Close all low-level file handles.
Insert File
Inserts a file into the edit file at the cursor.
Clipboard to print
Prints contents of the clipboard.
View Clipboard
Displays the clipboard.
FIGURE 1. Utility Menu
System File Edit Database Record Program Window Utility
┌────────────────────┐
│ Top │
│ Bottom │
│ Find │
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ │ Refind │
▀▀ ▀▀▀ ▀▀ ▀▀ ├────────────────────┤
▀▀ ▀ ▀▀ ▀▀ │ Locate procedure │
▀▀ ▀▀ ▀▀ │ Reload and locate │
▀▀ ▀▀▀ ▀▀▀▀▀ ▀▀▀▀▀ ▀▀ ▀▀ ▀▀▀├────────────────────┤
▀▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀▀▀▀▀▀▀▀ ▀│ Open file │
▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀│ Macros │▀
▀▀ ▀▀ ▀▀ ▀▀▀ ▀▀ ▀│ Tools │▀▀
▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀├────────────────────┤▀
▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀│ Insert file │
▀▀▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀│ Clipboard to print │
FoxPro 2.0 │ View clipboard │
(c) Fox Holdings 1989-91, Pat.Pen└────────────────────┘
FIGURE 2. Utility Menu Expanded
System File Edit Database Record Program Window Utility
┌────────────────────┐
│ Top │
│ Bottom │
│ Find │
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ │ Refind │
▀▀ ▀▀▀ ▀▀ ▀▀ ├────────────────────┤
▀▀ ▀ ▀▀ ▀▀ │ Locate procedure │
▀▀ ▀▀ ▀▀ │ Reload and locate │
┌───────────┐▀▀▀▀▀ ▀▀▀▀▀ ▀▀ ├────────────────────┤
│ Prg ├────────────────────────────────────────┤ Open file │
│ Project │ ┌──────────────┬───────────────────────┤ Macros │▀
▀│ Menu │ │ IF statement │ ┌──────────────────┬──┤ Tools │▀▀
│ Screen │ │ DO CASE │ │ FoxGen Menu │ ├────────────────────┤▀
│ Report │ │ DO LOOP │ │ PopGen Menu │ │ Insert file │
│ Query │▀│ FOR LOOP │ │ PadGen Menu │ │ Clipboard to print │
│ DBF │ │ SCAN │ │ Brow Wnd Layout │ │ View clipboard │
│ View │)│ Header │ │ Code to open DBF │ └────────────────────┘
│ Directory │ │ Date │ │ SetColor │
■└───────────┘ │ Marker │ │ Helper │ ≡
└──────────────┘ │ DBF Stru │
│ Cancel │
│ FCLOSE() ALL │
└──────────────────┘
FIGURE 3. Example Demonstrating Locate Procedure
System File Edit Database Record Program Window Utility
GOFER.PRG ┌─────Select Location──────┐
L: 284 C: 3 Ins │┌────────────────────────┐│
GO m.lastrec ││ FUNCTION INPUT ││
wait clear ││ FUNCTION XHELP ││
ENDIF ││ PROCEDURE ERRHAND ││
ENDIF ││ PROCEDURE FEDIT ││
ENDCASE ││ PROCEDURE GETKEY ││
* entire database being used ││ PROCEDURE INITHOT ││
CASE m.lkey<0 ││ PROCEDURE PEXIT ││
CASE m.lkey=6 ││ PROCEDURE SHUTDOWN ││
* end │└────────────────────────┘│
GO BOTT └──────────────────────────┘
CASE m.lkey=1
* home
GO TOP
CASE m.ndxchar.AND.m.ndxactive.AND.(BETWEEN(UPPER(CHR(m.lkey)),'A','Z').OR.;
BETWEEN(CHR(m.lkey),'0','9').OR.m.lkey=32)
FIGURE 4. Example Showing Browse Code.
* WINDOW definitions 02/04/92
IF !WEXIST("AUDIT")
* AUDIT
SELECT AUDIT
DEFINE WINDOW temp FROM 2,38 TO 10,79 FLOAT GROW ZOOM MINIMIZE SHAD
* D:\KONA\AUDIT.DBF 02/04/92 10:20:53
* FIELD COUNT: 9
* 1 TRIAL N
* 2 UNIT N
* 3 DATE D
* 4 SAMPLE_NO N
* 5 TEST C 4
* 6 OLDVALUE N
* 7 NEWVALUE N
* 8 CHANGED_BY C 10
* 9 REASON C 6
BROWSE FIELDS ;
TRIAL:H= [Trial],;
UNIT:H= [Unit],;
DATE:H= [Date],;
SAMPLE_NO:H= [Sample_no],;
TEST:H= [Test],;
OLDVALUE:H= [Oldvalue],;
NEWVALUE:H= [Newvalue],;
CHANGED_BY:H= [Changed_by],;
REASON:H= [Reason] ;
WINDOW temp COLOR SCHEME 10 NODELE TITLE [AUDIT] WIDTH 15 NOWAIT SAVE NOAPPEND
RELEASE WINDOW temp
ENDIF
IF !WEXIST("COMPOST")
* COMPOST
SELECT COMPOST
DEFINE WINDOW temp FROM 12,0 TO 22,79 FLOAT GROW ZOOM MINIMIZE SHAD
* D:\KONA\COMPOST.DBF 02/04/92 10:20:55
* FIELD COUNT: 46
* 1 TRIAL N
* 2 UNIT N
* 3 SAMPLE_NO N
* 4 PREP_DATE D
* 5 STARTCOMP D
* 6 STOPCOMP D
* 7 ENDDATE D
* 8 FILM_ID N
* 9 IV_BASE N
* 10 NOTES M
* 11 OBSER C 5
* 12 THK_INIT N
* 13 THK_INSTD N
* 14 THK_FINAL N
* 15 THK_FISTD N
* 16 WT_INIT N
* 17 WT_FINAL N
* 18 TEN_INIT N
* 19 TEN_FINAL N
* 20 ELON_INIT N
* 21 ELON_FINAL N
* 22 TAN_INIT N
* 23 TAN_FINAL N
* 24 NMR_DESC M
* 25 POLY_INIT N
* 26 POLY_FINAL N
* 27 CAP_INIT N
* 28 CAP_FINAL N
* 29 WT3_INIT N
* 30 WT3_FINAL N
* 31 WT4_INIT N
* 32 WT4_FINAL N
* 33 DS_INIT N
* 34 DS_FINAL N
* 35 PRO_INIT N
* 36 PRO_FINAL N
* 37 BUT_INIT N
* 38 BUT_FINAL N
* 39 SUCC_INIT N
* 40 SUCC_FINAL N
* 41 MN_INIT N
* 42 MN_FINAL N
* 43 MW_INIT N
* 44 MW_FINAL N
* 45 MZ_INIT N
* 46 MZ_FINAL N
BROWSE FIELDS ;
TRIAL:H= [Trial],;
UNIT:H= [Unit],;
SAMPLE_NO:H= [Sample_no],;
PREP_DATE:H= [Prep_date],;
STARTCOMP:H= [Startcomp],;
STOPCOMP:H= [Stopcomp],;
ENDDATE:H= [Enddate],;
FILM_ID:H= [Film_id],;
IV_BASE:H= [Iv_base],;
NOTES:H= [Notes],;
OBSER:H= [Obser],;
THK_INIT:H= [Thk_init],;
THK_INSTD:H= [Thk_instd],;
THK_FINAL:H= [Thk_final],;
THK_FISTD:H= [Thk_fistd],;
WT_INIT:H= [Wt_init],;
WT_FINAL:H= [Wt_final],;
TEN_INIT:H= [Ten_init],;
TEN_FINAL:H= [Ten_final],;
ELON_INIT:H= [Elon_init],;
ELON_FINAL:H= [Elon_final],;
TAN_INIT:H= [Tan_init],;
TAN_FINAL:H= [Tan_final],;
NMR_DESC:H= [Nmr_desc],;
POLY_INIT:H= [Poly_init],;
POLY_FINAL:H= [Poly_final],;
CAP_INIT:H= [Cap_init],;
CAP_FINAL:H= [Cap_final],;
WT3_INIT:H= [Wt3_init],;
WT3_FINAL:H= [Wt3_final],;
WT4_INIT:H= [Wt4_init],;
WT4_FINAL:H= [Wt4_final],;
DS_INIT:H= [Ds_init],;
DS_FINAL:H= [Ds_final],;
PRO_INIT:H= [Pro_init],;
PRO_FINAL:H= [Pro_final],;
BUT_INIT:H= [But_init],;
BUT_FINAL:H= [But_final],;
SUCC_INIT:H= [Succ_init],;
SUCC_FINAL:H= [Succ_final],;
MN_INIT:H= [Mn_init],;
MN_FINAL:H= [Mn_final],;
MW_INIT:H= [Mw_init],;
MW_FINAL:H= [Mw_final],;
MZ_INIT:H= [Mz_init],;
MZ_FINAL:H= [Mz_final] ;
WINDOW temp COLOR SCHEME 10 NODELE TITLE [COMPOST] WIDTH 15 NOWAIT SAVE NOAPPEND
RELEASE WINDOW temp
ENDIF
IF !WEXIST("NOTEBOOK")
* NOTEBOOK
SELECT NOTEBOOK
DEFINE WINDOW temp FROM 2,0 TO 10,35 FLOAT GROW ZOOM MINIMIZE SHAD
* D:\KONA\NOTEBOOK.DBF 02/04/92 10:20:57
* FIELD COUNT: 5
* 1 TRIAL N
* 2 NOTEBOOK C 8
* 3 DATE D
* 4 DESC M
* 5 COMPLETED L
BROWSE FIELDS ;
TRIAL:H= [Trial],;
NOTEBOOK:H= [Notebook],;
DATE:H= [Date],;
DESC:H= [Desc],;
COMPLETED:H= [Completed] ;
WINDOW temp COLOR SCHEME 10 NODELE TITLE [NOTEBOOK] WIDTH 15 NOWAIT SAVE NOAPPEND
RELEASE WINDOW temp
ENDIF
IF !WEXIST("SYS_INFO")
* SYS_INFO
SELECT SYS_INFO
DEFINE WINDOW temp FROM 1,0 TO 18,59 FLOAT GROW ZOOM MINIMIZE SHAD
* D:\KONA\SYS_INFO.DBF 02/04/92 10:20:58
* FIELD COUNT: 4
* 1 OK L
* 2 FILM_ID N
* 3 CHARGE C 6
* 4 SUBMIT_BY C 9
BROWSE FIELDS ;
OK:H= [Ok],;
FILM_ID:H= [Film_id],;
CHARGE:H= [Charge],;
SUBMIT_BY:H= [Submit_by] ;
WINDOW temp COLOR SCHEME 10 NODELE TITLE [SYS_INFO] WIDTH 15 NOWAIT SAVE NOAPPEND
RELEASE WINDOW temp
ENDIF
IF !WEXIST("FILM")
* FILM
SELECT FILM
DEFINE WINDOW temp FROM 2,38 TO 10,79 FLOAT GROW ZOOM MINIMIZE SHAD
* D:\KONA\FILM.DBF 02/04/92 10:20:59
* FIELD COUNT: 4
* 1 FILM_ID N
* 2 SASS C 4
* 3 DESC C 4
* 4 CHARGE C 6
BROWSE FIELDS ;
FILM_ID:H= [Film_id],;
SASS:H= [Sass],;
DESC:H= [Desc],;
CHARGE:H= [Charge] ;
WINDOW temp COLOR SCHEME 10 NODELE TITLE [FILM] WIDTH 15 NOWAIT SAVE NOAPPEND
RELEASE WINDOW temp
ENDIF
FIGURE 5. Code To Open Databases.
* Created 02/04/92 10:30:36 WITH GETSTAT
CLOSE DATABASE
* SYS_INFO
SELECT 1
USE SYS_INFO.DBF ALIAS SYS_INFO
* PHDATA
SELECT 2
USE PHDATA.DBF ALIAS PHDATA
SET ORDER TO TAG TRIALC IN PHDATA && STR(TRIAL,5)+STR(UNIT,2)
* AUDIT
SELECT 3
USE AUDIT.DBF ALIAS AUDIT
SET ORDER TO TAG TRIALC IN AUDIT && STR(TRIAL,5)
* FILM
SELECT 5
USE FILM.DBF ALIAS FILM
* FILM_A
SELECT 6
USE FILM.DBF AGAIN ALIAS FILM_A
* COMPOST
SELECT 7
USE COMPOST.DBF ALIAS COMPOST
SET ORDER TO TAG TRIALC IN COMPOST && STR(TRIAL,5)+STR(UNIT,2)+STR(SAMPLE_NO,3)
SET RELATION TO STR(TRIAL,5)+STR(UNIT,2) INTO PHDATA
* NOTEBOOK
SELECT 8
USE NOTEBOOK.DBF ALIAS NOTEBOOK
SET ORDER TO TAG TRIALC IN NOTEBOOK && STR(TRIAL,5)
SET RELATION TO STR(TRIAL,5) INTO AUDIT ADDITIVE
SET SKIP TO NOTE2
* NOTEBOOK_B
SELECT 9
USE NOTEBOOK.DBF ALIAS NOTEBOOK_B
* NOTE2
SELECT 25
USE NOTEBOOK.DBF ALIAS NOTE2
SET ORDER TO TAG TRIALC IN NOTEBOOK && STR(TRIAL,5)
SET RELATION TO STR(TRIAL,5) INTO COMPOST
SET SKIP TO COMPOST
SELECT NOTEBOOK
SET RELATION TO STR(TRIAL,5) INTO NOTE2
Figure 6. Helper
System File Edit Database Record Program Window Utility
┌──────────────────┐
│ HELPER │
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ├──────────────────┤▀▀▀▀▀▀▀▀
▀▀ ▀▀▀ │ ACTIVE PROGRAMS │▀ ▀▀
▀▀ ▀ │ ACTIVE DATABASES │▀ ▀▀
▀▀ │ FREE-FORM │▀ ▀▀
▀▀ ▀▀▀ │ FILER │▀ ▀▀ ▀▀▀ ▀▀▀▀ ▀▀▀
▀▀▀▀▀ ▀▀ ▀│ SWEEP │▀▀▀▀▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀
▀▀ ▀▀ │ LOCATE FILE │▀ ▀▀▀ ▀▀ ▀▀
▀▀ ▀▀ │ SYS Functions │▀ ▀▀ ▀▀ ▀▀
▀▀ ▀▀ │ SET STATUS │▀ ▀▀ ▀▀ ▀▀
▀▀ ▀▀ ▀│ COLOR │▀ ▀▀ ▀▀ ▀▀
▀▀▀▀▀▀▀ ▀▀▀ │ LIBRARY │▀▀▀ ▀▀▀▀▀▀ ▀▀▀
│ COLOR STRING │o 2.0
│ BROWSE COLORS │989-91, Pat.Pend.
├──────────────────┤an Edition
■ │ TOGGLE WINDOW │ Command ≡
│ QUIT │
└──────────────────┘
Display active programs.