База данных страховой компании
S,COLS,ROWS(?POINT)) ! SCROLL THE SCREEN UP
GET(TABLE,RECORDS(TABLE)) ! GET RECORD FROM TABLE
DO FILL_SCREEN ! DISPLAY ON SCREEN
.
OF PGDN_KEY !PAGE DOWN KEY
DO SET_NEXT ! POINT TO NEXT RECORD
DO NEXT_PAGE ! DISPLAY THE NEXT PAGE
OF CTRL_PGDN !CTRL-PAGE DOWN KEY
DO LAST_PAGE ! DISPLAY THE LAST PAGE
NDX = RECORDS(TABLE) ! POSITION POINT BAR
OF UP_KEY !UP ARROW KEY
DO SET_PREV ! POINT TO PREVIOUS RECORD
DO FILL_PREV ! FILL A TABLE ENTRY
IF FOUND ! FOUND A NEW RECORD
SCROLL(ROW,COL,ROWS,COLS,-(ROWS(?POINT))) ! SCROLL THE SCREEN DOWN
GET(TABLE,1) ! GET RECORD FROM TABLE
DO FILL_SCREEN ! DISPLAY ON SCREEN
.
OF PGUP_KEY !PAGE UP KEY
DO SET_PREV ! POINT TO PREVIOUS RECORD
DO PREV_PAGE ! DISPLAY THE PREVIOUS PAGE
OF CTRL_PGUP !CTRL-PAGE UP
DO FIRST_PAGE ! DISPLAY THE FIRST PAGE
NDX = 1 ! POSITION POINT BAR
. . .
FREE(TABLE) !FREE MEMORY TABLE
FREE(XRE:K) !FREE CACHE
RETURN !AND RETURN TO CALLER
SAME_PAGE ROUTINE !DISPLAY THE SAME PAGE
GET(TABLE,1) ! GET THE FIRST TABLE ENTRY
DO FILL_RECORD ! FILL IN THE RECORD
SET(XRE:K,XRE:K,TBL:PTR) ! POSITION FILE
FREE(TABLE) ! EMPTY THE TABLE
DO NEXT_PAGE ! DISPLAY A FULL PAGE
FIRST_PAGE ROUTINE !DISPLAY FIRST PAGE
FREE(TABLE) ! EMPTY THE TABLE
CLEAR(XRE:RECORD,-1) ! CLEAR RECORD TO LOW VALUES
CLEAR(TBL:PTR) ! ZERO RECORD POINTER
SET(XRE:K) ! POINT TO FIRST RECORD
LOOP NDX = 1 TO COUNT ! FILL UP THE TABLE
DO FILL_NEXT ! FILL A TABLE ENTRY
IF NOT FOUND THEN BREAK. ! GET OUT IF NO RECORD
.
NDX = 1 ! SET TO TOP OF TABLE
DO SHOW_PAGE ! DISPLAY THE PAGE
LAST_PAGE ROUTINE !DISPLAY LAST PAGE
NDX# = NDX ! SAVE SELECTOR POSITION
FREE(TABLE) ! EMPTY THE TABLE
CLEAR(XRE:RECORD,1) ! CLEAR RECORD TO HIGH VALUES
CLEAR(TBL:PTR,1) ! CLEAR PTR TO HIGH VALUE
SET(XRE:K) ! POINT TO FIRST RECORD
LOOP NDX = COUNT TO 1 BY -1 ! FILL UP THE TABLE
DO FILL_PREV ! FILL A TABLE ENTRY
IF NOT FOUND THEN BREAK. ! GET OUT IF NO RECORD
. ! END OF LOOP
NDX = NDX# ! RESTORE SELECTOR POSITION
DO SHOW_PAGE ! DISPLAY THE PAGE
FIND_RECORD ROUTINE !POSITION TO SPECIFIC RECORD
SET(XRE:K,XRE:K,NEWPTR) !POSITION FILE
IF NEWPTR = 0 !NEWPTR NOT SET
NEXT(XREG) ! READ NEXT RECORD
NEWPTR = POINTER(XREG) ! SET NEWPTR
SKIP(XREG,-1) ! BACK UP TO DISPLAY RECORD
.
FREE(TABLE) ! CLEAR THE RECORD
DO NEXT_PAGE ! DISPLAY A PAGE
NEXT_PAGE ROUTINE !DISPLAY NEXT PAGE
SAVECNT# = RECORDS(TABLE) ! SAVE RECORD COUNT
LOOP COUNT TIMES ! FILL UP THE TABLE
DO FILL_NEXT ! FILL A TABLE ENTRY
IF NOT FOUND ! IF NONE ARE LEFT
IF NOT SAVECNT# ! IF REBUILDING TABLE
DO LAST_PAGE ! FILL IN RECORDS
EXIT ! EXIT OUT OF ROUTINE
.
BREAK ! EXIT LOOP
. .
DO SHOW_PAGE ! DISPLAY THE PAGE
SET_NEXT ROUTINE !POINT TO THE NEXT PAGE
GET(TABLE,RECORDS(TABLE)) ! GET THE LAST TABLE ENTRY
DO FILL_RECORD ! FILL IN THE RECORD
SET(XRE:K,XRE:K,TBL:PTR) ! POSITION FILE
NEXT(XREG) ! READ THE CURRENT RECORD
FILL_NEXT ROUTINE !FILL NEXT TABLE ENTRY
FOUND = FALSE ! ASSUME RECORD NOT FOUND
LOOP UNTIL EOF(XREG) ! LOOP UNTIL END OF FILE
NEXT(XREG) ! READ THE NEXT RECORD
FOUND = TRUE ! SET RECORD FOUND
DO FILL_TABLE ! FILL IN THE TABLE ENTRY
ADD(TABLE) ! ADD LAST TABLE ENTRY
GET(TABLE,RECORDS(TABLE)-COUNT) ! GET ANY OVERFLOW RECORD
DELETE(TABLE) ! AND DELETE IT
EXIT ! RETURN TO CALLER
.
PREV_PAGE ROUTINE !DISPLAY PREVIOUS PAGE
LOOP COUNT TIMES ! FILL UP THE TABLE
DO FILL_PREV ! FILL A TABLE ENTRY
IF NOT FOUND THEN BREAK. ! GET OUT IF NO RECORD
.
DO SHOW_PAGE ! DISPLAY THE PAGE
SET_PREV ROUTINE !POINT TO PREVIOUS PAGE
GET(TABLE,1) ! GET THE FIRST TABLE ENTRY
DO FILL_RECORD ! FILL IN THE RECORD
SET(XRE:K,XRE:K,TBL:PTR) ! POSITION FILE
PREVIOUS(XREG) ! READ THE CURRENT RECORD
FILL_PREV ROUTINE !FILL PREVIOUS TABLE ENTRY
FOUND = FALSE ! ASSUME RECORD NOT FOUND
LOOP UNTIL BOF(XREG) ! LOOP UNTIL BEGINNING OF FILE
PREVIOUS(XREG) ! READ THE PREVIOUS RECORD
FOUND = TRUE SET RECORD FOUND
DO FILL_TABLE ! FILL IN THE TABLE ENTRY
ADD(TABLE,1) ! ADD FIRST TABLE ENTRY
GET(TABLE,COUNT+1) ! GET ANY OVERFLOW RECORD
DELETE(TABLE) ! AND DELETE IT
EXIT ! RETURN TO CALLER
.
SHOW_PAGE ROUTINE !DISPLAY THE PAGE
NDX# = NDX ! SAVE SCREEN INDEX
LOOP NDX = 1 TO RECORDS(TABLE) ! LOOP THRU THE TABLE
GET(TABLE,NDX) ! GET A TABLE ENTRY
DO FILL_SCREEN AND DISPLAY IT
IF TBL:PTR = NEWPTR ! SET INDEX FOR NEW RECORD
NDX# = NDX ! POINT TO CORRECT RECORD
. .
LOOP WHILE NDX <= COUNT ! FINISH BLANKING THE SCREEN
BLANK(ROW(?POINT),COL(?POINT),ROWS(?POINT),COLS(?POINT)) !BLANK A LINE
NDX += 1 ! INCREMENT NDX
.
NDX = NDX# ! RESTORE SCREEN INDEX
NEWPTR = 0 ! CLEAR NEW RECORD POINTER
CLEAR(XRE:RECORD) ! CLEAR RECORD AREA
FILL_TABLE ROUTINE !MOVE FILE TO TABLE
TBL:IREG = XRE:IREG
TBL:NREG = XRE:NREG
TBL:PTR = POINTER(XREG) ! SAVE RECORD POINTER
FILL_RECORD ROUTINE !MOVE TABLE TO FILE
XRE:NREG = TBL:NREG
FILL_SCREEN ROUTINE !MOVE TABLE TO SCREEN
SCR:IREG = TBL:IREG
GET_RECORD ROUTINE !GET SELECTED RECORD
GET(TABLE,NDX) ! GET TABLE ENTRY
GET(XREG,TBL:PTR) ! GET THE RECORD
(ant4)
MEMBER('ANT')
MEN2 PROCEDURE
SCREEN SCREEN PRE(SCR),WINDOW(6,25),AT(9,27),HUE(5,3)
ROW(1,1) STRING('+-{23}+')
ROW(2,1) REPEAT(4);STRING('¦<0{23}>¦') .
ROW(6,1) STRING('+-{23}+')
ROW(2,7) STRING('<130>выберите<0,0>год')
ENTRY,USE(?FIRST_FIELD) ENTRY,USE(?PRE_MENU) MENU,USE(MENU_FIELD"),REQ
ROW(4,8) STRING('1. 1992 год')
ROW(5,8) STRING('2. 1993 год')
. .
EJECT
CODE
OPEN(SCREEN) !OPEN THE MENU SCREEN
SETCURSOR !TURN OFF ANY CURSOR
MENU_FIELD" = '' !START MENU WITH FIRST ITEM
IF CHOICE()=1 THEN MEM:PR=1 ELSE MEM:PR=2. !CALL SETUP PROCEDURE
LOOP !LOOP UNTIL USER EXITS
ALERT !TURN OFF ALL ALERTED KEYS
ALERT(REJECT_KEY) !ALERT SCREEN REJECT KEY
ALERT(ACCEPT_KEY) !ALERT SCREEN ACCEPT KEY
ACCEPT !READ A FIELD OR MENU CHOICE
IF KEYCODE() = REJECT_KEY THEN RETURN. !RETURN ON SCREEN REJECT
IF KEYCODE() = ACCEPT_KEY !ON SCREEN ACCEPT KEY
UPDATE ! MOVE ALL FIELDS FROM SCREEN
SELECT(?) ! START WITH CURRENT FIELD
SELECT ! EDIT ALL FIELDS
CYCLE ! GO TO TOP OF LOOP
. !
CASE FIELD() !JUMP TO FIELD EDIT ROUTINE
OF ?FIRST_FIELD !FROM THE FIRST FIELD
IF KEYCODE() = ESC_KEY THEN RETURN. ! RETURN ON ESC KEY
OF ?PRE_MENU !PRE MENU FIELD CONDITION
IF KEYCODE() = ESC_KEY ! BACKING UP?
SELECT(?-1) ! SELECT PREVIOUS FIELD
ELSE ! GOING FORWARD
SELECT(?+1) ! SELECT MENU FIELD
.
OF ?MENU_FIELD" !FROM THE MENU FIELD
EXECUTE CHOICE() ! CALL THE SELECTED PROCEDURE
MEN4 !
MEN4 !
. . .
(ant5)
MEMBER('ANT')
MEN4 PROCEDURE
SCREEN SCREEN PRE(SCR),WINDOW(10,36),AT(6,23),HUE(5,3)
ROW(1,1) STRING('+-{34}+')
ROW(2,1) REPEAT(3),EVERY(3);STRING('¦<0{34}>¦') .
ROW(3,1) STRING('¦<0{9},130>ведите<0>границы<0{10}>¦')
ROW(4,1) STRING('¦<0{12}>в<0>тыс<0>руб<0{13}>¦')
ROW(6,1) STRING('¦<0{4}>минимальную<0{19}>¦')
ROW(7,1) STRING('¦<0{4}>максимальную<0{18}>¦')
ROW(9,1) STRING('¦<0{34}>¦')
ROW(10,1) STRING('+-{34}+')
ROW(4,13) STRING('(')
COL(19) STRING('.')
COL(23) STRING('.)')
ENTRY,USE(?FIRST_FIELD)
ROW(6,19)ENTRY(@n_9),USE(MEM:
скачать реферат
1 2 3 4 5 6 7 ... последняя