home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
brokcode.zip
/
MEMOEDIT.EXE
/
MEMO3.CLA
< prev
next >
Wrap
Text File
|
1991-12-05
|
4KB
|
101 lines
MEMBER('MEMO')
UPD_MEMOTEST PROCEDURE
SCREEN SCREEN WINDOW(24,80),PRE(SCR),HUE(15,1)
ROW(1,1) STRING('┌─{78}┐')
ROW(2,1) REPEAT(22);STRING('│<0{78}>│') .
ROW(24,1) STRING('└─{78}┘')
ROW(8,3) STRING('Comments'),HUE(11,1)
COL(12) STRING('(Press <<'),HUE(11,1)
COL(20) STRING('F1'),HUE(14,1)
MESSAGE ROW(3,26) STRING(30),HUE(0,3)
COL(56) ENTRY,USE(?FIRST_FIELD)
ROW(5,11) STRING('Name '),HUE(11,1)
COL(16) ENTRY(@S30),USE(FIL:Name),HUE(15,1),SEL(14,4),REQ
ROW(6,4) STRING('Description '),HUE(11,1)
COL(16) ENTRY(@S50),USE(FIL:Descript),HUE(15,1),SEL(14,4)
ROW(8,22) STRING('> for Editor Help) '),HUE(11,1)
COL(41) ENTRY(@P*P),USE(MEM:DummyField),HUE(15,1)
REPEAT(15),INDEX(RepNdx)
MemoLine ROW(9,3) STRING(76),HUE(15,1)
.
COL(79) ENTRY,USE(?LAST_FIELD)
COL(79) PAUSE(''),USE(?DELETE_FIELD)
.
RepNdx BYTE ! Repeat index
EJECT
CODE
OPEN(SCREEN) !OPEN THE SCREEN
SETCURSOR !TURN OFF ANY CURSOR
DISPLAY !DISPLAY THE FIELDS
LOOP RepNdx = 1 TO 15 !Display the memo field
SCR:MemoLine = Fil_Memo_Row[RepNdx] !
. !
LOOP !LOOP THRU ALL THE FIELDS
MEM:MESSAGE = CENTER(MEM:MESSAGE,SIZE(MEM:MESSAGE)) !DISPLAY ACTION MESSAGE
DO CALCFIELDS !CALCULATE DISPLAY FIELDS
ALERT !RESET ALERTED KEYS
ALERT(ACCEPT_KEY) !ALERT SCREEN ACCEPT KEY
ALERT(REJECT_KEY) !ALERT SCREEN REJECT KEY
ACCEPT !READ A FIELD
IF KEYCODE() = REJECT_KEY THEN RETURN. !RETURN ON SCREEN REJECT KEY
EXECUTE ACTION !SET MESSAGE
MEM:MESSAGE = 'Record will be Added' !
MEM:MESSAGE = 'Record will be Changed' !
MEM:MESSAGE = 'Press Enter to Delete' !
.
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
IF ACTION = 3 THEN SELECT(?DELETE_FIELD).! OR CONFIRM FOR DELETE
OF ?FIL:Name
IF DUPLICATE(FIL:BY_Name) ! CHECK FOR DUPLICATE KEY
MEM:MESSAGE = 'CREATES DUPLICATE ENTRY' ! MOVE AN ERROR MESSAGE
SELECT(?FIL:Name) ! STAY ON THE SAME FIELD
BEEP ! SOUND THE KEYBOARD ALARM
CYCLE ! AND LOOP AGAIN
.
OF ?MEM:DummyField ! Edit the memo field
Junk# = MemoEdit(Fil_Memo_Row[],SCR:MemoLine,RepNdx,15)
OF ?LAST_FIELD !FROM THE LAST FIELD
EXECUTE ACTION ! UPDATE THE FILE
ADD(MEMOTEST) ! ADD NEW RECORD
PUT(MEMOTEST) ! CHANGE EXISTING RECORD
DELETE(MEMOTEST) ! DELETE EXISTING RECORD
.
IF ERRORCODE() = 40 ! DUPLICATE KEY ERROR
MEM:MESSAGE = ERROR() ! DISPLAY ERR MESSAGE
SELECT(2) ! POSITION TO TOP OF FORM
CYCLE ! GET OUT OF EDIT LOOP
ELSIF ERROR() ! CHECK FOR UNEXPECTED ERROR
STOP(ERROR()) ! HALT EXECUTION
.
ACTION = 0 ! SET ACTION TO COMPLETE
RETURN ! AND RETURN TO CALLER
OF ?DELETE_FIELD !FROM THE DELETE FIELD
IF KEYCODE() = ENTER_KEY | ! ON ENTER KEY
OR KEYCODE() = ACCEPT_KEY ! OR CTRL-ENTER KEY
SELECT(?LAST_FIELD) ! DELETE THE RECORD
ELSE ! OTHERWISE
BEEP ! BEEP AND ASK AGAIN
. . .
CALCFIELDS ROUTINE
IF FIELD() > ?FIRST_FIELD !BEYOND FIRST_FIELD?
IF KEYCODE() = 0 AND SELECTED() > FIELD() THEN EXIT. !GET OUT IF NOT NONSTOP
.
SCR:MESSAGE = MEM:MESSAGE