home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / GLIB14.ZIP / FED-DEMO.BAS < prev    next >
Encoding:
BASIC Source File  |  1988-02-06  |  20.2 KB  |  572 lines

  1. REM $TITLE:      'FED - DEMO'
  2. REM $SUBTITLE:  'Text input demo '
  3. REM  (C) InfoSoft, 1987, 1988
  4.  
  5. COMMON /fedvars/ fg%, bg%, fgd%, bgd%, alarm%, edited%, nums%, num$, upcase%
  6.  
  7. CLEAR
  8. DEFINT A-Z
  9. OPTION BASE 1
  10.  
  11.  
  12. TYPE structure
  13.    nname AS STRING * 25
  14.    phone AS STRING * 8
  15.    addr AS STRING * 25
  16.    city AS STRING * 10
  17.    state AS STRING * 2
  18.    zip AS STRING * 5
  19.    dept AS STRING * 6
  20.    superv AS STRING * 12
  21.    pfreq AS STRING * 1
  22.    prate AS SINGLE
  23.    pin AS INTEGER
  24. END TYPE
  25.  
  26.   DIM emp AS structure
  27.  
  28. 'make sure it is set up right
  29. CLS : SOUND 750, 2: LOCATE 5, 5
  30. PRINT "Depending on your display, you may want to restart this demo"
  31. LOCATE 7, 5
  32. PRINT "with the command line parameter [/CMD /NC] or [/CMD /C]. /NC for"
  33. LOCATE 9, 5
  34. PRINT "No Color, /C for color version.   This should be noted in F-DEMO.BAT"
  35. LOCATE 13, 5
  36. PRINT "Tap `S' to stop the demo, any other key to continue."
  37.  
  38. GOSUB wait.key
  39.  
  40. IF ky$ = "S" OR ky$ = "s" THEN
  41.    GOTO ext
  42. END IF
  43.  
  44. '*********** get command line parms and set colors
  45. DIM arg$(2): q% = 0
  46. FOR x = 1 TO 2
  47.    arg$(x) = SPACE$(LEN(COMMAND$) / 2)
  48. NEXT x
  49. CALL cmdline(arg$(), q%)
  50.  
  51. IF arg$(1) = "/NC" THEN                 ' find out if command line wants color
  52.    fg = 7: bg = 0
  53.    fge = 15: bge = 0
  54.    fgw = 0: bgw = 7
  55.    fgd = 15: bgd = 0
  56.    fgh = 7: bgh = 15
  57.    fgb = 15: bgb = 0
  58.    fgt = 7: bgt = 0
  59. ELSE
  60.    fg = 2: bg = 0                ' general colors
  61.    fge = 12: bge = 3             ' err message colors
  62.    fgw = 14: bgw = 4             ' window colors
  63.    fgd = 10: bgd = 0             ' data colors
  64.    fgh = 15: bgh = 1             ' help colors
  65.    fgb = 4: bgb = 0              ' box color
  66.    fgt = 3: bgt = 0              ' text colors
  67. END IF
  68.  
  69. eattr = (bge * 16) + fge         ' error message attributes
  70. wattr = (bgw * 16) + fgw         ' window attributes
  71. hattr = (bgh * 16) + fgh         ' help window attributes
  72.  
  73.  
  74. REM $DYNAMIC
  75. REDIM sarry(4000)                     'dimension screen array for 2 screens
  76. REM $STATIC
  77. GOSUB set.pointers
  78.  
  79.  
  80. DIM hlp$(10)      ' String array to hold help screen msgs for use later.
  81.           ' Has to be DIMmed in code prior to other references
  82.           ' to hlp$().
  83.  
  84.    hlp$(1) = "Home - Start of line             End - End of line"
  85.    hlp$(2) = "  "
  86.    hlp$(3) = "Ctrl-X  Clear Field      Ctrl-End  Clear to end of line"
  87.    hlp$(4) = "Ctrl-U  Undo             <Arrows> Fwd, Bkwd 1 field "
  88.    hlp$(5) = "  "
  89.    hlp$(6) = "       PgUp / Ctrl PgUp - Jump to first field "
  90.    hlp$(7) = "       PgDn / Ctrl PgDn - Jump to last field  "
  91.    hlp$(8) = "  "
  92.    hlp$(9) = "[Esc] or [F9] Aborts Current Edit      [F10] Save Record"
  93.  
  94.    hlp$(10) = "[ Tap any key to continue ]"
  95.  
  96.  
  97.  
  98. prg.start:              '*************** start of program  *****************
  99.  
  100.  
  101. GOSUB gen.disp                        ' put screen mask on screen
  102. CALL svscrn(segmt1, sptr1)            ' save it - RSTSCRN is quicker next time
  103.  
  104. GOSUB openfil                         ' open the file
  105.  
  106. IF hi = 0 THEN GOSUB newfil
  107. recno = hi                            ' get the top rec no
  108.  
  109. GOSUB rec.disp                        ' display given record
  110.  
  111. '*****************************************************************************
  112. '*  Each label below the sets up the flags and variables for editing for one *
  113. '*  of the fields in the database or on the screen.  A MAJOR part of the     *
  114. '*  Field EDitor (FED), is in the subroutine called CHGFLD, which routes the *
  115. '*  flow of the code to the appropriate points.  The random access file      *
  116. '*  contained here is pretty minimal - just enough to be able to demo FED.   *
  117. '*  In a "real" random file application, there are a number of things that   *
  118. '*  should be done in the way of checking for valid data, also, there are    *
  119. '*  functions missing like to delete a record (missing because it does not   *
  120. '*  lend itself to demoing FED or GIZLIB).  There ARE several other GIZLIB   *
  121. '*  functions used: ERRMSG, DLRFRMAT, NFRMAT, WDW and a few others.          *
  122. '*****************************************************************************
  123.  
  124.  
  125. ed.n:                        '-----  edit name  ------
  126.    LOCATE 4, 10                       ' FED parameters
  127.    upcase = 1
  128.    nums = 0
  129.    alarm = 1                          ' turn caps only ON, nums only OFF,
  130.    fsiz = 25                          '   error sound ON, set size of string
  131.    CALL fed(mname$, fsiz%, fcode%)
  132.  
  133.         '--- handles part of the return from FED ----------
  134.    IF fcode = 5 THEN                             ' if up arrow, go up one
  135.      GOTO ed.n
  136.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  137.      GOSUB chgfld                               ' see where they want to go
  138.    END IF
  139.  
  140.     ' if down or enter pressed, just advance one field
  141.  
  142.  
  143.  
  144. ed.p:                        ' ----- edit phone number ---------
  145.    LOCATE 4, 57
  146.    upcase = 0: nums = 1: num$ = "1234567890-": bleep = 1
  147.    fsiz = 8: temp$ = mphone$           ' save a copy of phone in case of error
  148.    CALL fed(temp$, fsiz%, fcode%)
  149.    m = 2: p = 0                        ' m sets NFRMAT mode, p is useless here
  150.    CALL nfrmat(temp$, m, p)
  151.  
  152.    IF m = 2 THEN                             ' if format went okay
  153.      mphone$ = temp$                        ' assign value to memory var
  154.    ELSE                                      ' something went wrong !!
  155.      CALL errmsg(temp$, 24, eattr%, 2)      ' tell them of error
  156.      GOTO ed.p                              ' note that we do not know what the
  157.    END IF                                    ' error is! Just that there is one
  158.  
  159.    IF fcode = 5 THEN                             ' up arrow...
  160.      GOTO ed.n                                  ' ...back up one field
  161.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  162.      GOSUB chgfld                               ' see where they want to go
  163.    END IF
  164.  
  165.  
  166. ed.a:                             '-----  edit address  -----
  167.    LOCATE 6, 13
  168.    nums = 0: upcase = 0: alarm = 1
  169.    fsiz = 25:                            ' nums only OFF, caps OFF, bleepr ON
  170.    CALL fed(maddr$, fsiz%, fcode%)
  171.    IF fcode = 5 THEN                             ' up arrow
  172.      GOTO ed.p
  173.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  174.      GOSUB chgfld                               ' see where they want to go
  175.    END IF
  176.  
  177.  
  178. ed.c:                            ' -----  edit city  -----
  179.    LOCATE 8, 10
  180.    upcase = 1: nums = 0: alarm = 1
  181.    fsiz = 10                               ' caps ON, nums only OFF, sound ON
  182.    CALL fed(mcity$, fsiz%, fcode%)
  183.  
  184.    IF fcode = 5 THEN                             ' up arrow
  185.      GOTO ed.a
  186.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  187.      GOSUB chgfld                               ' see where they want to go
  188.    END IF
  189.  
  190.  
  191. ed.s:                            ' -----  edit state  -----
  192.    LOCATE 8, 42
  193.    fsiz = 2: alarm = 0                           ' turn sound ON, set size
  194.    CALL fed(mstate$, fsiz%, fcode%)
  195.  
  196.    IF fcode = 5 THEN                             ' up arrow
  197.      GOTO ed.c
  198.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  199.      GOSUB chgfld                               ' see where they want to go
  200.    END IF
  201.  
  202. ed.z:                            '-----  edit zip code  -----
  203.    LOCATE 8, 60
  204.    nums = 1: num$ = "1234567890": alarm = 0
  205.    fsiz = 5                             ' turn nums only ON, bleepr OFF
  206.  
  207.    CALL fed(mzip$, fsiz%, fcode%)
  208.  
  209.    IF fcode = 5 THEN                             ' up arrow
  210.      GOTO ed.s
  211.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  212.      GOSUB chgfld                               ' see where they want to go
  213.    END IF
  214.  
  215.  
  216. ed.d:                            '-----  edit department  -----
  217.    LOCATE 12, 16
  218.    upcase = 1: nums = 0: alarm = 1
  219.    fsiz = 6                               ' caps ON, nums only OFF, bleepr ON
  220.  
  221.    CALL fed(mdept$, fsiz%, fcode%)
  222.  
  223.    IF fcode = 5 THEN                             ' up arrow
  224.      GOTO ed.z
  225.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  226.      GOSUB chgfld                               ' see where they want to go
  227.    END IF
  228.  
  229.  
  230. ed.sv:                            '-----  edit supervisor name  -----
  231.    LOCATE 12, 57
  232.    fsiz = 12                          ' same bleepr, caps and nums state
  233.    CALL fed(msuperv$, fsiz%, fcode%)
  234.  
  235.    IF fcode = 5 THEN                             ' up arrow
  236.      GOTO ed.d
  237.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  238.      GOSUB chgfld                               ' see where they want to go
  239.    END IF
  240.  
  241.  
  242. ed.pf:                           '-----  edit pay freq  -----
  243.    LOCATE 14, 41
  244.    fsiz = 1                                  ' same caps etc settings
  245.    temp$ = mpfreq$                           ' save a copy cause they can
  246.    CALL fed(temp$, fsiz%, fcode%)            '   screw it up
  247.    temp$ = UCASE$(temp$)
  248.    IF INSTR("HS", temp$) = 0 THEN
  249.      CALL errmsg("Pay Frequency code must be H or S only.", 24, eattr%, 2)
  250.      GOTO ed.pf
  251.    END IF
  252.    mpfreq$ = temp$                               ' assign correct one
  253.  
  254.    IF fcode = 5 THEN                             ' up arrow
  255.      GOTO ed.sv
  256.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  257.      GOSUB chgfld                               ' see where they want to go
  258.    END IF
  259.  
  260.  
  261. ed.r:                              '-----  edit pay rate  -----
  262.    LOCATE 14, 70                          'turn nums only on, turn OFF bleepr
  263.  
  264.    nums = 1: num$ = "1234567890.$"
  265.    alarm = 0
  266.    fsiz = 6: temp$ = mprat$
  267.    CALL fed(temp$, fsiz%, fcode%)
  268.    m = 0: p = 2                   ' set up for dollar formatting call
  269.    CALL dlrfrmat(temp$, m%, p%)
  270.  
  271.    IF m <> 0 THEN                   ' if m is changed
  272.      CALL errmsg(temp$, 24, eattr, 2)        '
  273.      GOTO ed.r
  274.    END IF
  275.    mprat$ = temp$
  276.  
  277.    IF fcode = 5 THEN                             ' up arrow
  278.      GOTO ed.pf
  279.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  280.      GOSUB chgfld                               ' see where they want to go
  281.    END IF
  282.  
  283.  
  284. ed.pin:                            '-----  edit PIN code  -----
  285.    LOCATE 16, 17: PRINT mpin$           ' it is previuosly hidden
  286.    nums = 1: num$ = "1234567890"
  287.    alarm = 0: fsiz = 4                   ' bleep is same as last one, but
  288.    LOCATE 16, 17                         ' they can JUMP here via PgDn
  289.  
  290.    CALL fed(mpin$, fsiz%, fcode%)
  291.    LOCATE 16, 17: PRINT STRING$(4, 254)          ' re hide their code
  292.  
  293.  
  294.    IF fcode = 5 THEN                             ' up arrow
  295.      GOTO ed.r
  296.    ELSEIF fcode <> 6 OR fcode <> 0 THEN          ' if NOT down or enter
  297.      GOSUB chgfld                               ' see where they want to go
  298.    END IF
  299.  
  300.  
  301.  
  302. savrec:                         ' save a record
  303.    GOSUB closefil                    ' LSET and close the file
  304.    edt = 0                           ' reset the edit flag
  305.    GOSUB show.rec                    ' show the new version
  306.    GOTO ed.n                         ' go to first field
  307.  
  308.  
  309. ext:
  310. SYSTEM
  311. '================================[ SUBROUTINES ]==============================
  312.  
  313. '******************************************************************************
  314. '*  In the way that FED is implemented here, most all of the FED Exit codes   *
  315. '* (aka FCODE), can be handled in a gosub to something like the following.    *
  316. '* Regardless of what field they are editting, F9, F10, F1, PgUp, PgDn etc    *
  317. '* all mean the same thing: abort, save, help, Jump to start, jump to end etc *
  318. '* The only FCODE that cannot be handled here (given the way that I have      *
  319. '* this implementation set up) is and Up Arrow (fcode=5).  ENTER, and Dn Arrow*
  320. '* (fcodes 0 and 6) are not handled here or at all actually, they "fall thru" *
  321. '* to the next label rather than being routed here.                           *
  322. '* Some sort of routine like this is essential to FED's operation.            *
  323. '******************************************************************************
  324.  
  325. chgfld:
  326.  
  327. IF edt THEN                        ' This part is not critical,
  328.    COLOR bgb, fgb                  '  but shows user when current
  329.    LOCATE 1, 35                    '  record is different from data
  330.    PRINT " [ EDITING ] "           '  in file.
  331. ELSE
  332.    COLOR fgb, bgb
  333.    LOCATE 1, 38
  334.    PRINT STRING$(15, 205);        ' overwrite EDITING flag
  335. END IF
  336. COLOR fg, bg
  337.  
  338.  
  339. SELECT CASE fcode            ' CASE is new to QB 3.0 - will not compile in 2.x
  340.  
  341.  CASE 1                                        ' F1 key pressed (HELP)
  342.     CALL svscrn(segmt2, sptr2)                   ' save screen as is
  343.     CALL wdw(7, 12, 17, 72, 1, 1, 2, hattr, "Editing Help")
  344.  
  345.     FOR x = 1 TO 9                                 ' pop help window up
  346.     CALL quikprt(hlp$(x), 7 + x, 14, hattr%)
  347.     NEXT x                                         ' QUIKPRT help msgs
  348.     LOCATE 18, 30: COLOR fgh, bgh: PRINT hlp$(10)
  349.  
  350.     GOSUB wait.key                                 ' wait for any key
  351.     CALL rstscrn(segmt2, sptr2)                    ' restore pre help screen
  352.     RETURN                                         ' RETURN to next label
  353.  
  354.  
  355.  CASE 3                                        ' F3 page back a record
  356.     IF edt THEN                                  ' they have changed something
  357.       CALL errmsg("You cannot PAGE until current edit is saved.", 24, eattr%, 2)
  358.       RETURN
  359.     END IF
  360.  
  361.     IF recno > 1 THEN recno = recno - 1      ' back up a record
  362.  
  363.     CALL rstscrn(segmt1, sptr1)              ' restore blank screen (bleed thru)
  364.     GOSUB rec.disp                               ' display desired record
  365.     RETURN ed.n                                  ' goto first field
  366.  
  367.  
  368.  
  369.   CASE 4                                       ' F4 page forward a record
  370.     IF edt THEN                                  ' they have changed something
  371.       CALL errmsg("You cannot PAGE until current edit is saved.", 24, eattr%, 2)
  372.       RETURN
  373.     END IF
  374.  
  375.     IF recno < hi THEN recno = recno + 1        ' forward a record
  376.  
  377.     CALL rstscrn(segmt1, sptr1)
  378.     GOSUB rec.disp                               ' display desired record
  379.     RETURN ed.n                                  ' goto first field
  380.  
  381.  
  382.   CASE 7                                       ' F7 add a record
  383.     IF edt THEN
  384.       CALL errmsg("Cannot ADD until current EDIT is saved.", 24, eattr, 2)
  385.     ELSE
  386.       recno = hi + 1                           ' increment record pointer
  387.                 ' ----  set all mem vars to nul strings  -----
  388.       mname$ = "": mphone$ = "": maddr$ = "": mcity$ = "": mstate$ = ""
  389.       mzip$ = "": mdept$ = "": msuperv$ = "": mpfreq$ = ""
  390.       mprat$ = "": mpin$ = STRING$(4, 254)
  391.  
  392.       CALL rstscrn(segmt1, sptr1)
  393.       GOSUB show.rec                             ' display
  394.       RETURN ed.n
  395.     END IF
  396.  
  397.  
  398.   CASE 8                                  ' F8 - quit demo
  399.     SYSTEM
  400.  
  401.  
  402.   CASE 9, 15                              ' F9, ESC
  403.     recno = 1                             ' this should have a "ARE YOU SURE"
  404.     GOSUB rec.disp                         ' prompt if it was more than demo
  405.     RETURN ed.n                            ' redisplay current record
  406.  
  407.  
  408.   CASE 10                                     ' F10 save record
  409.     RETURN savrec
  410.  
  411.   CASE 11, 13                                  'Pg Up or ^Pg Up
  412.     RETURN ed.n
  413.  
  414.   CASE 12, 14                                  'Pg Dn or ^Pg Dn
  415.     RETURN ed.pin
  416.  
  417.   CASE ELSE                              ' handles all other fed codes
  418.     RETURN                               ' (F2, etc - advance a field)
  419.  
  420. END SELECT
  421.  
  422.  
  423.  
  424.  
  425. openfil:         '-----------   open demo file statements  ---------
  426.    OPEN "emp.dat" FOR RANDOM AS #1 LEN = LEN(emp)
  427.    sof = LOF(1) / LEN(emp)               ' sof is number of records in file
  428.    hi = sof                              ' hi is high record number
  429. RETURN
  430.  
  431.  
  432. closefil:       '-------------   store the record ---------------
  433.    emp.nname = mname$: emp.phone = mphone$: emp.addr = maddr$
  434.    emp.city = mcity$: emp.state = mstate$: emp.zip = mzip$
  435.    emp.dept = mdept$: emp.superv = msuperv$: emp.pfreq = mpfreq$
  436.    emp.prate = VAL(mprat$): emp.pin = VAL(mpin$)
  437.  
  438.  
  439.    PUT #1, recno, emp                      ' move record to buffer
  440.    CLOSE #1                            ' actually put file to disk
  441.    GOSUB openfil                       ' open file again in updated state
  442. RETURN
  443.  
  444.  
  445. rec.disp:            '---------- put selected record to the screen  -----------
  446.  
  447.                 ' convert to memory variable to edit a COPY
  448.                 ' of each and strip trailing blanks
  449.    GET #1, recno, emp
  450.  
  451.    mname$ = emp.nname:       mname$ = RTRIM$(mname$)
  452.    mphone$ = emp.phone:      mphone$ = RTRIM$(mphone$)
  453.    maddr$ = emp.addr:        maddr$ = RTRIM$(maddr$)
  454.    mcity$ = emp.city:        mcity$ = RTRIM$(mcity$)
  455.    mstate$ = emp.state:      mstate$ = RTRIM$(mstate$)
  456.    mzip$ = emp.zip:          mzip$ = RTRIM$(mzip$)
  457.    mdept$ = emp.dept:        mdept$ = RTRIM$(mdept$)
  458.    msuperv$ = emp.superv:    msuperv$ = RTRIM$(msuperv$)
  459.    mpfreq$ = emp.pfreq:      mpfreq$ = RTRIM$(mpfreq$)
  460.    mprat$ = STR$(emp.prate): mprat$ = RTRIM$(LTRIM$(mprat$))
  461.    CALL dlrfrmat(mprat$, 2, 2)
  462.    mpin$ = STR$(emp.pin):    mpin$ = RTRIM$(LTRIM$(mpin$))
  463.  
  464.  
  465. show.rec:                  ' display the record
  466.  
  467. IF edt THEN                        ' This part is not critical,
  468.    COLOR bgb, fgb                  '  but shows user when current
  469.    LOCATE 1, 35                    '  record is different from data
  470.    PRINT " [ EDITING ] "           '  in file.
  471. ELSE
  472.    COLOR fgb, bgb
  473.    LOCATE 1, 35
  474.    PRINT STRING$(15, 205);
  475. END IF
  476. COLOR fg, bg
  477.  
  478.  
  479.    COLOR fg, bg
  480.    LOCATE 4, 10: PRINT mname$
  481.    LOCATE 4, 57: PRINT mphone$
  482.    LOCATE 6, 13: PRINT maddr$
  483.    LOCATE 8, 10: PRINT mcity$
  484.    LOCATE 8, 42: PRINT mstate$
  485.    LOCATE 8, 60: PRINT mzip$
  486.  
  487.    LOCATE 12, 16: PRINT mdept$
  488.    LOCATE 12, 57: PRINT msuperv$
  489.    LOCATE 14, 41: PRINT mpfreq$
  490.    LOCATE 14, 70: PRINT mprat$
  491.    LOCATE 16, 17: PRINT STRING$(4, 254)
  492.    LOCATE 16, 71: COLOR fgw, 0: PRINT recno%
  493.    COLOR fg, bg
  494.    edited = 0        ' set edit flag to show that record on screen is same as file
  495.  
  496. RETURN
  497.  
  498.  
  499.  
  500. gen.disp:
  501. '*****************************************************************************
  502. '*  Routine to put general display on the screen, this is used once.  After  *
  503. '*  it is put to the screen, it is saved via SVSCRN, and restored from there *
  504. '*  rather than doing all these PRINTs again.                                *
  505. '*****************************************************************************
  506.  
  507.    CALL boxes(5, 1, fgb)                   'put a big box on screen
  508.    COLOR fgt + 8
  509.    LOCATE 2, 25: PRINT "XYZ Corporation Employee Data File"      ' a title
  510.    COLOR fgt
  511.    LOCATE 4, 4: PRINT "Name: "
  512.    LOCATE 4, 50: PRINT "Phone: "
  513.    LOCATE 6, 4: PRINT "Address: "
  514.    LOCATE 8, 4: PRINT "City: "
  515.    LOCATE 8, 35: PRINT "State: "
  516.    LOCATE 8, 55: PRINT "Zip: "
  517.    LOCATE 12, 4: PRINT "Department: "
  518.    LOCATE 12, 45: PRINT "Supervisor: "
  519.    LOCATE 14, 4: PRINT "Hourly / Salary Level (H or S only): "
  520.    LOCATE 14, 60: PRINT "Pay Rate: "
  521.    LOCATE 16, 55: PRINT "Record Number: ";
  522.  
  523.  
  524.    LOCATE 16, 4: PRINT "4 Digit PIN: "
  525.    COLOR 4, 0: LOCATE 17, 1: PRINT CHR$(199) + STRING$(78, 196) + CHR$(182)
  526.    COLOR fgt + 8: LOCATE 18, 30: PRINT "Editing Keys:": COLOR fgt
  527.  
  528.    LOCATE 20, 10: PRINT "       [F8] - Quit                   [F9] - Abort Edit"
  529.    LOCATE 19, 10: PRINT "[F1] - Help         [F7] - Add Record         [F10] - Save"
  530.  
  531.    LOCATE 21, 10: PRINT "[F3] - Page back one record   [F4] - Page forward one record"
  532.    LOCATE 22, 10: PRINT "[Enter] - Advances a field.   [PgDn] - Jump to last field"
  533.    LOCATE 23, 5: PRINT "[PgUp] - Jump to first field   <Arrow Keys> Advance or back up one field."
  534.  
  535. RETURN
  536.  
  537.  
  538.  
  539. set.pointers:
  540.    segmt1 = VARSEG(sarry(1)): sptr1 = VARPTR(sarry(1))
  541.    segmt2 = VARSEG(sarry(2001)): sptr2 = VARPTR(sarry(2001))
  542. RETURN
  543.  
  544.  
  545.  
  546. newfil:       '---------------- make a new file if demo one got lost  -------
  547.    mname$ = "JIM LOTUS"
  548.    mphone$ = "555-0123"
  549.    maddr$ = "1432 OAK STREET"
  550.    mcity$ = "CENTERVILE"
  551.    mstate$ = "MA"
  552.    mzip$ = "01234"
  553.    mdept$ = "EXEC."
  554.    msuperv$ = "NONE"
  555.    mpfreq$ = "S"
  556.    mprat$ = "900.00"
  557.    mpin$ = "1234"
  558.  
  559.    recno = 1
  560.    GOSUB closefil
  561. RETURN
  562.  
  563. wait.key:             '--------loop until a key is pressed - handy to have
  564. ky$ = ""
  565. DO UNTIL ky$ <> ""
  566.   ky$ = INKEY$
  567. LOOP
  568. RETURN
  569.  
  570. REM x$include: 'fed.bas'
  571.  
  572.