home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / sri314_b.zip / DEMOPRGS.ZIP / EDBROW.PRG < prev    next >
Text File  |  1990-09-30  |  3KB  |  118 lines

  1. *** EDBROW.PRG **
  2. **  (C) Copyright 1990, Sub Rosa Publishing Inc.
  3. **  A demonstration program provided to SR-Info and VP-Info users.
  4. **  This program may be copied freely. If it is used in commercial code,
  5. **  please credit the source, Sub Rosa Publishing Inc.
  6. **
  7. **  EDBROW is compatible with all current versions of SR-Info and VP-Info.
  8. **  EDBROW demonstrates the use of the EDIT and BROWSE commands in tandom to
  9. **  work on a file. The consistancy of keystrokes across the two commands
  10. **  makes this a very good approach to data management.
  11. **
  12. **  Bernie Melman
  13. **
  14. *
  15. SET func off ; we want the raw function keys - not the pre-loaded messages.
  16. USE#1 members index members
  17.  
  18. IF :color <> 7
  19.    SET color to 32; black on green
  20. ENDIF
  21. COLOR :color,0,0,24,79,177; fill screen with pattern
  22. * 177 is a shaded fill character.
  23. DO WHILE t; put main menu in an infinite loop
  24.    WINDOW 6,18,19,62 double; declare space for menu text
  25.    MODE = '?'
  26.    ERASE; fills window with blanks
  27.    TEXT
  28.  
  29.           DEMO MAIN MENU
  30.  
  31.      0. Exit program and SR-Info.
  32.  
  33.      1. Choose a starting record.
  34.      2. Browse current record.
  35.      3. Edit current record.
  36.      4. About this sample program
  37.      5. Exit program - stay in SR-Info.
  38.  
  39.    ENDTEXT
  40.    CURSOR 12,26 ; positions menu cursor over 1st character of 1st choice
  41.    SELECTION = menu(5,36); five choices menu bar width 36
  42.    DO CASE
  43.    CASE selection=0
  44.       QUIT
  45.    CASE selection=1
  46.       PERFORM start_rec
  47.    CASE selection=2
  48.       mode='B'
  49.    CASE selection=3
  50.       mode='E'
  51.    case selection=4
  52.       perform tell_about
  53.    CASE selection=5
  54.       WINDOW; reset window to full screen
  55.       CURSOR 0,0; cursor to top left
  56.       CANCEL
  57.    ENDCASE
  58.    WINDOW 2,20
  59.    @ 22,5 say "PRESS F1 to toggle between BROWSE and EDIT"
  60.    @ 23,5 say "PRESS END to return to the main menu."
  61.    DO WHILE mode <> 'Q'
  62.       IF mode='E'
  63.          EDIT
  64.          IF :key=315
  65.             MODE = 'B'
  66.          ELSE 
  67.             mode='Q'
  68.          ENDIF
  69.       ELSE
  70.          BROWSE
  71.          IF :key=315
  72.             MODE = 'E'
  73.          ELSE 
  74.             mode='Q'
  75.          ENDIF
  76.       ENDIF
  77.    ENDDO
  78. ENDDO
  79. **** END OF EDBROW.PRG ***
  80. PROCEDURE start_rec
  81.    CLEAR gets
  82.    mkey=blank(10)
  83.    ERASE
  84.    TEXT
  85. ENTER ESTIMATE OF LAST NAME -
  86.   up to 10 characters
  87.  LAST NAME: @mkey
  88.    ENDTEXT
  89.    READ
  90.    MKEY = !(trim(mkey)) ; get rid of trailing blanks
  91.    FIND &mkey
  92.    IF #=0 ; no find - so go to next record
  93.       GOTO :near
  94.    ENDIF
  95. ENDPROCEDURE; start_rec
  96. PROCEDURE tell_about
  97. screen 1,2
  98. window
  99. erase
  100. window 5,5,20,75
  101. text
  102.                           About This Program:
  103.  
  104.      EDBROW demonstrates the use of the EDIT and BROWSE commands
  105.   in tandom to work on a file.
  106.   The consistancy of keystrokes across the two commands
  107.   makes this a very good approach to data management. Note that the
  108.   EDIT TEXT and EDIT OFF as well as BROWSE TEXT and BROWSE off
  109.   commands allow use of the same keystrokes with user designed
  110.   screens  and ON FIELD structures.
  111.  
  112.          *** Press the space bar to resume the program. ***
  113. endtext
  114. dummy = inkey()
  115. screen 2,1
  116. ENDPROCEDURE; tell_about
  117. ** end of EDBROW.PRG **
  118.