База данных страховой компании (DOCA4)

Посмотреть архив целиком

(ant3)


MEMBER('ANT')

REG PROCEDURE

SCREEN SCREEN PRE(SCR),WINDOW(25,39),AT(1,42),HUE(8,7)

ROW(2,9) PAINT(1,19),HUE(0,7)

ROW(1,1) STRING('+-{37}+')

ROW(2,1) REPEAT(2);STRING('¦<0{37}>¦') .

ROW(4,1) STRING('¦')

ROW(5,1) REPEAT(20);STRING('¦<0{37}>¦') .

ROW(25,1) STRING('+-{37}+')

ROW(2,12) STRING('<130>âûáåðèòå<0>ðåãèîí') ROW(4,39) STRING('¦')

ENTRY,USE(?FIRST_FIELD)

ENTRY,USE(?PRE_POINT) REPEAT(21),EVERY(1),INDEX(NDX)

COL(2) POINT(1,37),USE(?POINT),ESC(?-1)

IREG COL(3) STRING(35)

. .

NDX BYTE !REPEAT INDEX FOR POINT AREA

ROW BYTE !ACTUAL ROW OF SCROLL AREA

COL BYTE !ACTUAL COLUMN OF SCROLL AREA

COUNT BYTE(21) !NUMBER OF ITEMS TO SCROLL

ROWS BYTE(21) !NUMBER OF ROWS TO SCROLL

COLS BYTE(37) !NUMBER OF COLUMNS TO SCROLL

FOUND BYTE !RECORD FOUND FLAG

NEWPTR LONG !POINTER TO NEW RECORD

TABLE TABLE,PRE(TBL) !TABLE OF RECORD DATA

PTR LONG ! POINTER TO FILE RECORD

IREG STRING(35)

NREG SHORT

.

EJECT

CODE

ACTION# = ACTION !SAVE ACTION

OPEN(SCREEN) !OPEN THE SCREEN

SETCURSOR !TURN OFF ANY CURSOR

TBL:PTR = 1 !START AT TABLE ENTRY

NDX = 1 !PUT SELECTOR BAR ON TOP ITEM

ROW = ROW(?POINT) !REMEMBER TOP ROW AND

COL = COL(?POINT) !LEFT COLUMN OF SCROLL AREA

RECORDS# = TRUE !INITIALIZE RECORDS FLAG

CACHE(XRE:K,.25) !CACHE KEY FILE

IF ACTION = 4 ! TABLE LOOKUP REQUEST

NEWPTR = POINTER(XREG) ! SET POINTER TO RECORD

IF NOT NEWPTR ! RECORD NOT PASSED TO TABLE

SET(XRE:K,XRE:K) ! POSITION TO CLOSEST RECORD

NEXT(XREG) ! READ RECORD

NEWPTR = POINTER(XREG) ! SET POINTER

.

DO FIND_RECORD ! POSITION FILE

ELSE

NDX = 1 ! PUT SELECTOR BAR ON TOP ITEM

DO FIRST_PAGE ! BUILD MEMORY TABLE OF KEYS

.

RECORDS# = TRUE ! ASSUME THERE ARE RECORDS

LOOP !LOOP UNTIL USER EXITS

ACTION = ACTION# !RESTORE ACTION

ALERT !RESET ALERTED KEYS

ALERT(REJECT_KEY) !ALERT SCREEN REJECT KEY

ALERT(ACCEPT_KEY) !ALERT SCREEN ACCEPT KEY

ACCEPT !READ A FIELD

IF KEYCODE() = REJECT_KEY THEN BREAK. !RETURN ON SCREEN REJECT KEY

IF KEYCODE() = ACCEPT_KEY | !ON SCREEN ACCEPT KEY

AND FIELD() <> ?POINT !BUT NOT ON THE POINT FIELD

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 | ! RETURN ON ESC KEY

OR RECORDS# = FALSEá ! OR NO RECORDS

BREAK !EXIT PROCEDURE

.

OF ?PRE_POINT!PRE POINT FIELD CONDITION

IF KEYCODE() = ESC_KEY! BACKING UP?

SELECT(?-1) !SELECT PREVIOUS FIELD

ELSE ! GOING FORWARD

SELECT(?POINT) !SELECT MENU FIELD

.

OF ?POINT !PROCESS THE POINT FIELD

IF RECORDS(TABLE) = 0 !IF THERE ARE NO RECORDS

CLEAR(XRE:RECORD) ! CLEAR RECORD AREA

ACTION = 1 ! SET ACTION TO ADD

GET(XREG,0) ! CLEAR PENDING RECORD

NEWPTR = POINTER(XREG) !SET POINTER TO NEW RECORD

DO FIRST_PAGE ! DISPLAY THE FIRST PAGE

IF RECORDS(TABLE) = 0 ! IF THERE AREN'T ANY RECORDS

RECORDS# = FALSE !INDICATE NO RECORDS

SELECT(?PRE_POINT-1) !SELECT THE PRIOR FIELD

.

CYCLE !AND LOOP AGAIN

.

CASE KEYCODE() !PROCESS THE KEYSTROKE

OF INS_KEY !INS KEY

CLEAR(XRE:RECORD) ! CLEAR RECORD AREA

ACTION = 1 ! SET ACTION TO ADD

GET(XREG,0) ! CLEAR PENDING RECORD

IF ~ACTION ! IF RECORD WAS ADDED

NEWPTR = POINTER(XREG) !SET POINTER TO NEW RECORD

DO FIND_RECORD !POSITION IN FILE

.

OF ENTER_KEY !ENTER KEY

OROF ACCEPT_KEY !CTRL-ENTER KEY

DO GET_RECORD ! GET THE SELECTED RECORD

IF ACTION = 4 AND KEYCODE() = ENTER_KEY !IF THIS IS A LOOKUP REQUEST

ACTION = 0 !SET ACTION TO COMPLETE

BREAK !AND RETURN TO CALLER

.

IF ~ERROR() ! IF RECORD IS STILL THERE

ACTION = 2 !SET ACTION TO CHANGE

IF ACTION THEN CYCLE. !IF SUCCESSFUL RE-DISPLAY

.

NEWPTR = POINTER(XREG) !SET POINTER TO NEW RECORD

DO FIND_RECORD !POSITION IN FILE

OF DEL_KEY !DEL KEY

DO GET_RECORD ! READ THE SELECTED RECORD

IF ~ERROR() ! IF RECORD IS STILL THERE

ACTION = 3 !SET ACTION TO DELETE

IF ~ACTION !IF SUCCESSFUL

N# = NDX ! SAVE POINT INDEX

DO SAME_PAGE ! RE-DISPLAY

NDX = N# ! RESTORE POINT INDEX

. .

OF DOWN_KEY !DOWN ARROW KEY

DO SET_NEXT ! POINT TO NEXT RECORD

DO FILL_NEXT ! FILL A TABLE ENTRY

IF FOUND ! FOUND A NEW RECORD

SCROLL(ROW,COL,ROWS,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



Случайные файлы

Файл
102423.doc
35423.rtf
66094.rtf
worldwar2.doc
32228.rtf




Чтобы не видеть здесь видео-рекламу достаточно стать зарегистрированным пользователем.
Чтобы не видеть никакую рекламу на сайте, нужно стать VIP-пользователем.
Это можно сделать совершенно бесплатно. Читайте подробности тут.