home *** CD-ROM | disk | FTP | other *** search
- ***************************************************************************
- ** EDBROW.PRG
- ** (C) Copyright 1990-92, Sub Rosa Publishing Inc.
- **
- ** A demonstration program provided to VP-Info users.
- ** This program may be copied freely. If it is used in commercial code,
- ** please credit the source, Sub Rosa Publishing Inc.
- **
- ** EDBROW demonstrates the use of the EDIT and BROWSE commands in tandom to
- ** work on a file. The consistancy of keystrokes across the two commands
- ** makes this a very good approach to data management.
- **
- ** EDBROW is compatible with all current versions of VP-Info.
- **
- ** Sid Bursten and Bernie Melman
- ***************************************************************************
- SET func off ; we want the raw function keys - not the pre-loaded messages.
- ON escape
- WINDOW
- SET function on
- CANCEL
- ENDON
- USE#1 members index members
- IF :color <> 7
- SET color to 107; blue on brown
- ENDIF
- COLOR :color,0,0,24,79,177; fill screen with pattern
- * 177 is a shaded fill character.
- DO WHILE t; put main menu in an infinite loop
- WINDOW 6,18,19,62 double; declare space for menu text
- MODE = '?'
- ERASE; fills window with blanks
- TEXT
-
- Edit/Browse Demonstation
-
- 0. Exit to Conversational VP-Info
-
- 1. Choose a starting record.
- 2. Browse current record.
- 3. Edit current record.
- 4. Edit with custom screen.
- 5. Return to Main Samples Menu
- 6. Exit Info and return to DOS.
- ENDTEXT
- CURSOR 12,26 ; positions menu cursor over 1st character of 1st choice
- SELECTION = menu(6,36); six choices menu bar width 36
- DO CASE
- CASE selection=0
- WINDOW ;restore window to full screen
- SET function on
- CLS
- CANCEL
- CASE selection=1
- PERFORM start_rec
- CASE selection=2
- mode='B'
- CASE selection=3
- mode='E'
- CASE selection=4
- WINDOW ; restore window to full screen
- EDIT TEXT members ; use 'painted' screen MEMBERS.TXT
- mode='Q'
- COLOR :color,0,0,24,79,177; re-fill screen with pattern
- CASE selection=5
- CHAIN samples
- CASE selection=6
- QUIT
- ENDCASE
- WINDOW 2,20
- @ 22,5 say "PRESS F1 to toggle between BROWSE and EDIT."
- @ 23,5 say "PRESS END to return to the main menu. "
- DO WHILE mode <> 'Q'
- IF mode='E'
- EDIT
- IF :key=315
- MODE = 'B'
- ELSE
- mode='Q'
- ENDIF
- ELSE
- BROWSE
- IF :key=315
- MODE = 'E'
- ELSE
- mode='Q'
- ENDIF
- ENDIF
- ENDDO
- ENDDO
- *
- * *** END OF EDBROW.PRG mainline code ***
- *
- PROCEDURE start_rec
- CLEAR gets
- mkey=blank(10)
- ERASE
- TEXT
- ENTER ESTIMATE OF LAST NAME -
- up to 10 characters
- LAST NAME: @mkey
- ENDTEXT
- READ
- MKEY = !(trim(mkey)) ; get rid of trailing blanks
- FIND &mkey
- IF #=0 ; no find - so go to next record
- GOTO :near
- ENDIF
- ENDPROCEDURE; start_rec
- *
- *
- * *** end of EDBROW.PRG ***