home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / BASIC / GLIB14.ZIP / CHGFLD.SUB next >
Encoding:
Text File  |  1988-02-06  |  3.0 KB  |  101 lines

  1.  
  2. '================================[ SUBROUTINES ]==============================
  3.  
  4. '******************************************************************************
  5. '*  Depending on how FED is implemented, most all of the FED Exit codes (aka  *
  6. '*  FCODEs), can be handled in a GOSUB similiar to the following.             *
  7. '*  Regardless of what field they are editting, F9, F10, F1, PgUp, PgDn etc   *
  8. '*  all mean the same thing to FED: EXIT.  What you do, based on the FCODE,   *
  9. '*  controls the flow of the program.  Generally, the Up Arrow (fcode=5),     *
  10. '*  ENTER, and Dn Arrow, (fcodes 0 and 6) are best handled prior to getting   *
  11. '*  here, they "fall thru" to the next label rather than being routed here.   *
  12. '*  See FED-DEMO for examples.                                                *
  13. '*  Some sort of routine like this is essential to FED's operation.           *
  14. '*                                                                            *
  15. '*        PUT YOUR OWN LABELS IN FOR CORRECT OPERATION !!!!                   *
  16. '******************************************************************************
  17.  
  18. chgfld:
  19.  
  20. IF edt THEN               ' This part is not critical,
  21.    COLOR bgb, fgb           '  but shows user when current
  22.    LOCATE 1, 35            '  record is different from data
  23.    PRINT " [ EDITING ] "           '  in file.
  24. ELSE
  25.    COLOR fgb, bgb
  26.    LOCATE 1, 38
  27.    PRINT STRING$(15, 205);      ' overwrite EDITING flag
  28. END IF
  29. COLOR fg,bg
  30.  
  31.  
  32. SELECT CASE fcode         ' CASE is new to QB 3.0 - will not compile in 2.x
  33.  
  34.  CASE 1                        ' F1 key pressed (HELP)
  35.     CALL svscrn(sptr2%)                ' save screen as is
  36.     CALL wdw(7, 12, 17, 72, 1, 1, 2, hattr,"Editing Help")
  37.  
  38.     GOSUB display.help.window
  39.  
  40.     GOSUB wait.key            ' do a 'Press any key..." routine
  41.  
  42.     CALL rstscrn(sptr2%)               ' restore pre help screen
  43.     RETURN                       ' RETURN to next label
  44.  
  45.  CASE 2                        ' F2
  46.      ' include code for your F2 function
  47.    RETURN xxx
  48.  
  49.  CASE 3                        ' F3
  50.     ' include code for your F3 function
  51.    RETURN xxx
  52.  
  53.  
  54.   CASE 4                       ' F4
  55.     ' include your F4 code handling here
  56.    RETURN xxx
  57.  
  58.   ' 5 and 6 are arroq keys.   Handle OUTSIDE of this for speed !
  59.  
  60.  
  61.   CASE 7                       ' F7
  62.      ' include code for your F7 function
  63.    RETURN xxx
  64.  
  65.   CASE 8                       ' F8
  66.      ' include code for your F8 function
  67.    RETURN xxx
  68.  
  69.  
  70.   CASE 9, 15                       ' F9, ESC
  71.    ' include your own code handling        ' F9 and Esc  do not HAVE to be
  72.    RETURN xxx                   ' coupled, but this is how to do it
  73.                        ' with CASE
  74.  
  75.   CASE 10                      ' F10 save record
  76.      ' include code for your F10 function
  77.    RETURN xxx
  78.  
  79.  
  80.   CASE 11                       'Pg Up
  81.      ' include code for your PgUp function
  82.    RETURN xxx
  83.  
  84.  
  85.   CASE 12                       ' Ctrl Pg Up
  86.      ' include code for your Ctrl-PgUp function
  87.    RETURN xxx
  88.  
  89.  
  90.   CASE 13                       'Pg Dn
  91.      ' include code for your PgDn function
  92.    RETURN xxx
  93.  
  94.  
  95.   CASE 14                       'Ctrl - Pg Dn
  96.      ' include code for your Ctrl - PgDn function
  97.    RETURN xxx
  98.  
  99.  
  100. END SELECT
  101.