home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
sri314_b.zip
/
DEMOPRGS.ZIP
/
EDBROW.PRG
< prev
next >
Wrap
Text File
|
1990-09-30
|
3KB
|
118 lines
*** EDBROW.PRG **
** (C) Copyright 1990, Sub Rosa Publishing Inc.
** A demonstration program provided to SR-Info and 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 is compatible with all current versions of SR-Info and VP-Info.
** 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.
**
** Bernie Melman
**
*
SET func off ; we want the raw function keys - not the pre-loaded messages.
USE#1 members index members
IF :color <> 7
SET color to 32; black on green
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
DEMO MAIN MENU
0. Exit program and SR-Info.
1. Choose a starting record.
2. Browse current record.
3. Edit current record.
4. About this sample program
5. Exit program - stay in SR-Info.
ENDTEXT
CURSOR 12,26 ; positions menu cursor over 1st character of 1st choice
SELECTION = menu(5,36); five choices menu bar width 36
DO CASE
CASE selection=0
QUIT
CASE selection=1
PERFORM start_rec
CASE selection=2
mode='B'
CASE selection=3
mode='E'
case selection=4
perform tell_about
CASE selection=5
WINDOW; reset window to full screen
CURSOR 0,0; cursor to top left
CANCEL
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 ***
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
PROCEDURE tell_about
screen 1,2
window
erase
window 5,5,20,75
text
About This Program:
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. Note that the
EDIT TEXT and EDIT OFF as well as BROWSE TEXT and BROWSE off
commands allow use of the same keystrokes with user designed
screens and ON FIELD structures.
*** Press the space bar to resume the program. ***
endtext
dummy = inkey()
screen 2,1
ENDPROCEDURE; tell_about
** end of EDBROW.PRG **