home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / DATABASE / FPEDFN2.ZIP / UTIL.DOC < prev   
Text File  |  1992-02-05  |  16KB  |  493 lines

  1. FoxPro Editor Enhancements
  2. by
  3. Fred Wampler
  4. Ph (615)247-6674
  5.  
  6. The FoxPro editor enhancements become available once the program is started
  7. by typing:
  8.  
  9. DO UTIL
  10.  
  11. Locate UTIL.APP somewhere on your FoxPro 2 path so that it is available to
  12. all subdirectories.
  13.  
  14. A description for the menu items shown in Figure 1 follows:
  15.  
  16. Top
  17.   Go to first line in edit file.
  18.  
  19. Bottom
  20.   Go to last line in edit file.
  21.  
  22. Find
  23.   Same as ^F (search)
  24.  
  25. Refind
  26.   Same as ^G (search again)
  27.  
  28. Locate Procedure
  29.   See Figure 3.  Locates procedures, functions or lines starting with *-.
  30.   Wrap around must be set on in the search (^F) window.  The program works by
  31.   reading your backup file.  All procedures, functions and lines beginning
  32.   with *- are put into an array for selection.  The selected item is stuffed
  33.   into the search window (^F) and a search is made.  Items may be selected
  34.   from the list by pressing <Enter> or double clicking the mouse.  The
  35.   selection process can be aborted by pressing <Esc>.  An array is saved and
  36.   available for each file you are editing (so long as FoxPro is not
  37.   terminated) and you may switch amoung them as needed.  This eliminates
  38.   rebuilding the array each time you switch edit files.  When a procedure,
  39.   function or line starting with *- is added to your edit file,  the array
  40.   can be rebuilt using the RELOAD AND LOCATE function.  The edit file must be
  41.   saved (twice) so that the backup is current before using the RELOAD
  42.   function.
  43.  
  44. Reload and locate
  45.   See locate procedure above.
  46.  
  47. Open file
  48.  
  49.     Prg
  50.       Allows you to select or open a new file for editing.
  51.  
  52.     Project
  53.       Allows you to select and open a project.
  54.  
  55.     Menu
  56.       Allows you to create or select and open a menu.
  57.  
  58.     Screen
  59.       Allows you to create or select and open a screen.
  60.  
  61.     Report
  62.       Allows you to create or select and open a report.
  63.  
  64.     Query
  65.       Allows you to create or select and open a query.
  66.  
  67.     DBF
  68.       Allows you to open a DBF.
  69.  
  70.     View
  71.       Allows you to open the view window.
  72.  
  73.     Directory
  74.       Not avail.
  75.  
  76. Macros
  77.     IF Statement
  78.       Inserts IF-ENDIF into edit file.
  79.  
  80.     DO CASE
  81.       Inserts DO CASE CASE ENDCASE into edit file.
  82.  
  83.     DO WHILE LOOP
  84.       Inserts DO WHILE ENDDO into edit file.
  85.  
  86.     FOR LOOP
  87.       Inserts FOR ENDFOR into edit file.
  88.  
  89.     SCAN
  90.       Insert SCAN ENDSCAN into edit file.
  91.  
  92.     Header
  93.       Inserts header information into edit file.
  94.       * Program.:
  95.       * Author..:
  96.       * Date....:
  97.       * Notice..:
  98.       * Notes...:
  99.     Date
  100.       Inserts date into file.
  101.  
  102.     Marker
  103.       Inserts marker *- plus date into file
  104.  
  105. Tools
  106.     FoxGen Menu Generator
  107.       Generates menu fragments and places into file frag.pop
  108.  
  109.     PopGen
  110.       Generates menu fragments.
  111.  
  112.     PadGen
  113.       Generates menu fragments.
  114.  
  115.     Browse Window Layout
  116.       Builds a code fragment in file window.txt containing the browse window
  117.       coordinates and fields for databases open in work areas.  I use this by
  118.       opening the databases of interest in the view window.  I size the
  119.       browse windows and then call this option.  The browse windows are sized
  120.       based on the open browses.  All fields are included along with default
  121.       field headings. Much typing is saved.  See Figure 4.
  122.  
  123.     Code to open DBF (Generator)
  124.       Used to write code to relat.txt for opening databases and setting
  125.       relations.  Use the view window to open the databases and index files
  126.       and set relations.  Open the databases receiving the relation in the
  127.       lower numbered work areas.  Conversely, open the databases setting the
  128.       relations in higher numbered work areas.  See Figure 5.  Call this
  129.       option to write the code.
  130.  
  131.  
  132.     SetColor
  133.       Pick stored colorsets for objects such as menus, browse windows, etc.
  134.       Press <Enter> to accept or <Esc>
  135.  
  136.     Helper
  137.       Popup over running programs to provide all sorts of helpful
  138.       information. See Figure 6.
  139.  
  140.     DBF Stru
  141.       Display the database structure in a window.  Double-click or press
  142.       enter to insert into the edit program.
  143.  
  144.     Cancel
  145.       Cancel program.
  146.  
  147.     FCLOSE() ALL
  148.       Close all low-level file handles.
  149.  
  150. Insert File
  151.   Inserts a file into the edit file at the cursor.
  152.  
  153. Clipboard to print
  154.   Prints contents of the clipboard.
  155.  
  156. View Clipboard
  157.   Displays the clipboard.
  158.  
  159.  
  160. FIGURE 1. Utility Menu
  161.  System  File  Edit  Database  Record  Program  Window  Utility
  162.                                                        ┌────────────────────┐
  163.                                                        │ Top                │
  164.                                                        │ Bottom             │
  165.                                                        │ Find               │
  166.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀                    ▀▀▀▀▀▀▀▀▀▀▀       │ Refind             │
  167.    ▀▀         ▀▀▀                      ▀▀       ▀▀     ├────────────────────┤
  168.    ▀▀           ▀                      ▀▀        ▀▀    │ Locate procedure   │
  169.    ▀▀                                  ▀▀        ▀▀    │ Reload and locate  │
  170.    ▀▀          ▀▀▀      ▀▀▀▀▀  ▀▀▀▀▀   ▀▀       ▀▀  ▀▀▀├────────────────────┤
  171.    ▀▀▀▀▀    ▀▀     ▀▀     ▀▀    ▀▀     ▀▀▀▀▀▀▀▀▀      ▀│ Open file         │
  172.    ▀▀      ▀▀       ▀▀     ▀▀  ▀▀      ▀▀             ▀│ Macros            │▀
  173.    ▀▀     ▀▀         ▀▀     ▀▀▀        ▀▀             ▀│ Tools             │▀▀
  174.    ▀▀      ▀▀       ▀▀     ▀▀ ▀▀       ▀▀             ▀├────────────────────┤▀
  175.    ▀▀       ▀▀     ▀▀     ▀▀   ▀▀      ▀▀             ▀│ Insert file        │
  176.  ▀▀▀▀▀▀▀       ▀▀▀      ▀▀▀▀▀  ▀▀▀▀  ▀▀▀▀▀▀         ▀▀▀│ Clipboard to print │
  177.                                    FoxPro 2.0          │ View clipboard     │
  178.                       (c) Fox Holdings 1989-91, Pat.Pen└────────────────────┘
  179.  
  180. FIGURE 2. Utility Menu Expanded
  181.  
  182.  System  File  Edit  Database  Record  Program  Window  Utility
  183.                                                        ┌────────────────────┐
  184.                                                        │ Top                │
  185.                                                        │ Bottom             │
  186.                                                        │ Find               │
  187.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀                    ▀▀▀▀▀▀▀▀▀▀▀       │ Refind             │
  188.    ▀▀         ▀▀▀                      ▀▀       ▀▀     ├────────────────────┤
  189.    ▀▀           ▀                      ▀▀        ▀▀    │ Locate procedure   │
  190. ▀▀                                  ▀▀        ▀▀       │ Reload and locate  │
  191.   ┌───────────┐▀▀▀▀▀  ▀▀▀▀▀   ▀▀                       ├────────────────────┤
  192.   │ Prg       ├────────────────────────────────────────┤ Open file         │
  193.   │ Project   │ ┌──────────────┬───────────────────────┤ Macros            │▀
  194.  ▀│ Menu      │ │ IF statement │ ┌──────────────────┬──┤ Tools             │▀▀
  195.   │ Screen    │ │ DO CASE      │ │ FoxGen Menu      │  ├────────────────────┤▀
  196.   │ Report    │ │ DO LOOP      │ │ PopGen Menu      │  │ Insert file        │
  197.   │ Query     │▀│ FOR LOOP     │ │ PadGen Menu      │  │ Clipboard to print │
  198.   │ DBF       │ │ SCAN         │ │ Brow Wnd Layout  │  │ View clipboard     │
  199.   │ View      │)│ Header       │ │ Code to open DBF │  └────────────────────┘
  200.   │ Directory │ │ Date         │ │ SetColor         │
  201.  ■└───────────┘ │ Marker       │ │ Helper           │                          ≡
  202.                 └──────────────┘ │ DBF Stru         │
  203.                                  │ Cancel           │
  204.                                  │ FCLOSE() ALL     │
  205.                                  └──────────────────┘
  206.  
  207. FIGURE 3. Example Demonstrating Locate Procedure
  208.  System  File  Edit  Database  Record  Program  Window  Utility
  209.                                    GOFER.PRG    ┌─────Select Location──────┐
  210.     L: 284    C: 3    Ins                       │┌────────────────────────┐│
  211.           GO m.lastrec                          ││ FUNCTION INPUT         ││
  212.           wait clear                            ││ FUNCTION XHELP         ││
  213.         ENDIF                                   ││ PROCEDURE ERRHAND      ││
  214.       ENDIF                                     ││ PROCEDURE FEDIT        ││
  215.     ENDCASE                                     ││ PROCEDURE GETKEY       ││
  216.     * entire database being used                ││ PROCEDURE INITHOT      ││
  217.   CASE m.lkey<0                                 ││ PROCEDURE PEXIT        ││
  218.   CASE m.lkey=6                                 ││ PROCEDURE SHUTDOWN     ││
  219.     * end                                       │└────────────────────────┘│
  220.     GO BOTT                                     └──────────────────────────┘
  221.   CASE m.lkey=1
  222.     * home
  223.     GO TOP
  224.   CASE m.ndxchar.AND.m.ndxactive.AND.(BETWEEN(UPPER(CHR(m.lkey)),'A','Z').OR.;
  225.       BETWEEN(CHR(m.lkey),'0','9').OR.m.lkey=32)
  226.  
  227. FIGURE 4. Example Showing Browse Code.
  228.  
  229. * WINDOW definitions 02/04/92
  230. IF !WEXIST("AUDIT")
  231. * AUDIT        
  232.   SELECT AUDIT
  233. DEFINE WINDOW temp FROM 2,38 TO 10,79 FLOAT GROW ZOOM MINIMIZE SHAD
  234.  * D:\KONA\AUDIT.DBF 02/04/92 10:20:53
  235.  * FIELD COUNT: 9
  236.  *   1 TRIAL        N
  237.  *   2 UNIT         N
  238.  *   3 DATE         D
  239.  *   4 SAMPLE_NO    N
  240.  *   5 TEST         C 4
  241.  *   6 OLDVALUE     N
  242.  *   7 NEWVALUE     N
  243.  *   8 CHANGED_BY   C 10
  244.  *   9 REASON       C 6
  245.  BROWSE FIELDS ;
  246.  TRIAL:H= [Trial],;
  247.  UNIT:H= [Unit],;
  248.  DATE:H= [Date],;
  249.  SAMPLE_NO:H= [Sample_no],;
  250.  TEST:H= [Test],;
  251.  OLDVALUE:H= [Oldvalue],;
  252.  NEWVALUE:H= [Newvalue],;
  253.  CHANGED_BY:H= [Changed_by],;
  254.  REASON:H= [Reason] ; 
  255. WINDOW temp COLOR SCHEME 10 NODELE TITLE [AUDIT] WIDTH 15 NOWAIT SAVE NOAPPEND
  256. RELEASE WINDOW temp
  257. ENDIF
  258.  
  259. IF !WEXIST("COMPOST")
  260. * COMPOST        
  261.   SELECT COMPOST
  262. DEFINE WINDOW temp FROM 12,0 TO 22,79 FLOAT GROW ZOOM MINIMIZE SHAD
  263.  * D:\KONA\COMPOST.DBF 02/04/92 10:20:55
  264.  * FIELD COUNT: 46
  265.  *   1 TRIAL        N
  266.  *   2 UNIT         N
  267.  *   3 SAMPLE_NO    N
  268.  *   4 PREP_DATE    D
  269.  *   5 STARTCOMP    D
  270.  *   6 STOPCOMP     D
  271.  *   7 ENDDATE      D
  272.  *   8 FILM_ID      N
  273.  *   9 IV_BASE      N
  274.  *  10 NOTES        M
  275.  *  11 OBSER        C 5
  276.  *  12 THK_INIT     N
  277.  *  13 THK_INSTD    N
  278.  *  14 THK_FINAL    N
  279.  *  15 THK_FISTD    N
  280.  *  16 WT_INIT      N
  281.  *  17 WT_FINAL     N
  282.  *  18 TEN_INIT     N
  283.  *  19 TEN_FINAL    N
  284.  *  20 ELON_INIT    N
  285.  *  21 ELON_FINAL   N
  286.  *  22 TAN_INIT     N
  287.  *  23 TAN_FINAL    N
  288.  *  24 NMR_DESC     M
  289.  *  25 POLY_INIT    N
  290.  *  26 POLY_FINAL   N
  291.  *  27 CAP_INIT     N
  292.  *  28 CAP_FINAL    N
  293.  *  29 WT3_INIT     N
  294.  *  30 WT3_FINAL    N
  295.  *  31 WT4_INIT     N
  296.  *  32 WT4_FINAL    N
  297.  *  33 DS_INIT      N
  298.  *  34 DS_FINAL     N
  299.  *  35 PRO_INIT     N
  300.  *  36 PRO_FINAL    N
  301.  *  37 BUT_INIT     N
  302.  *  38 BUT_FINAL    N
  303.  *  39 SUCC_INIT    N
  304.  *  40 SUCC_FINAL   N
  305.  *  41 MN_INIT      N
  306.  *  42 MN_FINAL     N
  307.  *  43 MW_INIT      N
  308.  *  44 MW_FINAL     N
  309.  *  45 MZ_INIT      N
  310.  *  46 MZ_FINAL     N
  311.  BROWSE FIELDS ;
  312.  TRIAL:H= [Trial],;
  313.  UNIT:H= [Unit],;
  314.  SAMPLE_NO:H= [Sample_no],;
  315.  PREP_DATE:H= [Prep_date],;
  316.  STARTCOMP:H= [Startcomp],;
  317.  STOPCOMP:H= [Stopcomp],;
  318.  ENDDATE:H= [Enddate],;
  319.  FILM_ID:H= [Film_id],;
  320.  IV_BASE:H= [Iv_base],;
  321.  NOTES:H= [Notes],;
  322.  OBSER:H= [Obser],;
  323.  THK_INIT:H= [Thk_init],;
  324.  THK_INSTD:H= [Thk_instd],;
  325.  THK_FINAL:H= [Thk_final],;
  326.  THK_FISTD:H= [Thk_fistd],;
  327.  WT_INIT:H= [Wt_init],;
  328.  WT_FINAL:H= [Wt_final],;
  329.  TEN_INIT:H= [Ten_init],;
  330.  TEN_FINAL:H= [Ten_final],;
  331.  ELON_INIT:H= [Elon_init],;
  332.  ELON_FINAL:H= [Elon_final],;
  333.  TAN_INIT:H= [Tan_init],;
  334.  TAN_FINAL:H= [Tan_final],;
  335.  NMR_DESC:H= [Nmr_desc],;
  336.  POLY_INIT:H= [Poly_init],;
  337.  POLY_FINAL:H= [Poly_final],;
  338.  CAP_INIT:H= [Cap_init],;
  339.  CAP_FINAL:H= [Cap_final],;
  340.  WT3_INIT:H= [Wt3_init],;
  341.  WT3_FINAL:H= [Wt3_final],;
  342.  WT4_INIT:H= [Wt4_init],;
  343.  WT4_FINAL:H= [Wt4_final],;
  344.  DS_INIT:H= [Ds_init],;
  345.  DS_FINAL:H= [Ds_final],;
  346.  PRO_INIT:H= [Pro_init],;
  347.  PRO_FINAL:H= [Pro_final],;
  348.  BUT_INIT:H= [But_init],;
  349.  BUT_FINAL:H= [But_final],;
  350.  SUCC_INIT:H= [Succ_init],;
  351.  SUCC_FINAL:H= [Succ_final],;
  352.  MN_INIT:H= [Mn_init],;
  353.  MN_FINAL:H= [Mn_final],;
  354.  MW_INIT:H= [Mw_init],;
  355.  MW_FINAL:H= [Mw_final],;
  356.  MZ_INIT:H= [Mz_init],;
  357.  MZ_FINAL:H= [Mz_final] ; 
  358. WINDOW temp COLOR SCHEME 10 NODELE TITLE [COMPOST] WIDTH 15 NOWAIT SAVE NOAPPEND
  359. RELEASE WINDOW temp
  360. ENDIF
  361.  
  362. IF !WEXIST("NOTEBOOK")
  363. * NOTEBOOK        
  364.   SELECT NOTEBOOK
  365. DEFINE WINDOW temp FROM 2,0 TO 10,35 FLOAT GROW ZOOM MINIMIZE SHAD
  366.  * D:\KONA\NOTEBOOK.DBF 02/04/92 10:20:57
  367.  * FIELD COUNT: 5
  368.  *   1 TRIAL        N
  369.  *   2 NOTEBOOK     C 8
  370.  *   3 DATE         D
  371.  *   4 DESC         M
  372.  *   5 COMPLETED    L
  373.  BROWSE FIELDS ;
  374.  TRIAL:H= [Trial],;
  375.  NOTEBOOK:H= [Notebook],;
  376.  DATE:H= [Date],;
  377.  DESC:H= [Desc],;
  378.  COMPLETED:H= [Completed] ; 
  379. WINDOW temp COLOR SCHEME 10 NODELE TITLE [NOTEBOOK] WIDTH 15 NOWAIT SAVE NOAPPEND
  380. RELEASE WINDOW temp
  381. ENDIF
  382.  
  383. IF !WEXIST("SYS_INFO")
  384. * SYS_INFO        
  385.   SELECT SYS_INFO
  386. DEFINE WINDOW temp FROM 1,0 TO 18,59 FLOAT GROW ZOOM MINIMIZE SHAD
  387.  * D:\KONA\SYS_INFO.DBF 02/04/92 10:20:58
  388.  * FIELD COUNT: 4
  389.  *   1 OK           L
  390.  *   2 FILM_ID      N
  391.  *   3 CHARGE       C 6
  392.  *   4 SUBMIT_BY    C 9
  393.  BROWSE FIELDS ;
  394.  OK:H= [Ok],;
  395.  FILM_ID:H= [Film_id],;
  396.  CHARGE:H= [Charge],;
  397.  SUBMIT_BY:H= [Submit_by] ; 
  398. WINDOW temp COLOR SCHEME 10 NODELE TITLE [SYS_INFO] WIDTH 15 NOWAIT SAVE NOAPPEND
  399. RELEASE WINDOW temp
  400. ENDIF
  401.  
  402. IF !WEXIST("FILM")
  403. * FILM        
  404.   SELECT FILM
  405. DEFINE WINDOW temp FROM 2,38 TO 10,79 FLOAT GROW ZOOM MINIMIZE SHAD
  406.  * D:\KONA\FILM.DBF 02/04/92 10:20:59
  407.  * FIELD COUNT: 4
  408.  *   1 FILM_ID      N
  409.  *   2 SASS         C 4
  410.  *   3 DESC         C 4
  411.  *   4 CHARGE       C 6
  412.  BROWSE FIELDS ;
  413.  FILM_ID:H= [Film_id],;
  414.  SASS:H= [Sass],;
  415.  DESC:H= [Desc],;
  416.  CHARGE:H= [Charge] ; 
  417. WINDOW temp COLOR SCHEME 10 NODELE TITLE [FILM] WIDTH 15 NOWAIT SAVE NOAPPEND
  418. RELEASE WINDOW temp
  419. ENDIF
  420.  
  421.  
  422. FIGURE 5. Code To Open Databases.
  423.  
  424. * Created 02/04/92 10:30:36 WITH GETSTAT
  425. CLOSE DATABASE
  426. * SYS_INFO
  427. SELECT 1
  428. USE SYS_INFO.DBF ALIAS SYS_INFO
  429. * PHDATA
  430. SELECT 2
  431. USE PHDATA.DBF ALIAS PHDATA
  432. SET ORDER TO TAG TRIALC IN PHDATA   && STR(TRIAL,5)+STR(UNIT,2)    
  433. * AUDIT
  434. SELECT 3
  435. USE AUDIT.DBF ALIAS AUDIT
  436. SET ORDER TO TAG TRIALC IN AUDIT   && STR(TRIAL,5)    
  437. * FILM
  438. SELECT 5
  439. USE FILM.DBF ALIAS FILM
  440. * FILM_A
  441. SELECT 6
  442. USE FILM.DBF AGAIN ALIAS FILM_A
  443. * COMPOST
  444. SELECT 7
  445. USE COMPOST.DBF ALIAS COMPOST
  446. SET ORDER TO TAG TRIALC IN COMPOST   && STR(TRIAL,5)+STR(UNIT,2)+STR(SAMPLE_NO,3)    
  447. SET RELATION TO STR(TRIAL,5)+STR(UNIT,2) INTO PHDATA
  448. * NOTEBOOK
  449. SELECT 8
  450. USE NOTEBOOK.DBF ALIAS NOTEBOOK
  451. SET ORDER TO TAG TRIALC IN NOTEBOOK   && STR(TRIAL,5)    
  452. SET RELATION TO STR(TRIAL,5) INTO AUDIT ADDITIVE
  453. SET SKIP TO NOTE2
  454. * NOTEBOOK_B
  455. SELECT 9
  456. USE NOTEBOOK.DBF ALIAS NOTEBOOK_B
  457. * NOTE2
  458. SELECT 25
  459. USE NOTEBOOK.DBF ALIAS NOTE2
  460. SET ORDER TO TAG TRIALC IN NOTEBOOK   && STR(TRIAL,5)    
  461. SET RELATION TO STR(TRIAL,5) INTO COMPOST
  462. SET SKIP TO COMPOST
  463. SELECT NOTEBOOK
  464. SET RELATION TO STR(TRIAL,5) INTO NOTE2
  465.  
  466. Figure 6.  Helper
  467.  
  468.  System  File  Edit  Database  Record  Program  Window  Utility
  469.  
  470.  
  471.                     ┌──────────────────┐
  472.                     │     HELPER       │
  473.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀   ├──────────────────┤▀▀▀▀▀▀▀▀
  474.    ▀▀         ▀▀▀   │ ACTIVE PROGRAMS  │▀       ▀▀
  475.    ▀▀           ▀   │ ACTIVE DATABASES │▀        ▀▀
  476.    ▀▀               │ FREE-FORM        │▀        ▀▀
  477.    ▀▀          ▀▀▀  │ FILER            │▀       ▀▀  ▀▀▀   ▀▀▀▀         ▀▀▀
  478.    ▀▀▀▀▀    ▀▀     ▀│ SWEEP            │▀▀▀▀▀▀▀▀      ▀▀ ▀▀   ▀▀    ▀▀     ▀▀
  479.    ▀▀      ▀▀       │ LOCATE FILE      │▀             ▀▀▀          ▀▀       ▀▀
  480.    ▀▀     ▀▀        │ SYS Functions    │▀             ▀▀          ▀▀         ▀▀
  481.    ▀▀      ▀▀       │ SET STATUS       │▀             ▀▀           ▀▀       ▀▀
  482.    ▀▀       ▀▀     ▀│ COLOR            │▀             ▀▀            ▀▀     ▀▀
  483.  ▀▀▀▀▀▀▀       ▀▀▀  │ LIBRARY          │▀▀▀         ▀▀▀▀▀▀             ▀▀▀
  484.                     │ COLOR STRING     │o 2.0
  485.                     │ BROWSE COLORS    │989-91, Pat.Pend.
  486.                     ├──────────────────┤an Edition
  487.           ■         │ TOGGLE WINDOW    │ Command                               ≡
  488.                     │ QUIT             │
  489.                     └──────────────────┘
  490.  
  491.  
  492.                             Display active programs.
  493.