home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
clndr.zip
/
CALENDAR.CLA
< prev
next >
Wrap
Text File
|
1990-02-10
|
33KB
|
791 lines
TITLE('APPOINTMENT CALENDAR SCREEN')
CALENDAR PROGRAM
INCLUDE('\CLARION\CTL_KEYS') !COPY IN CTL_KEYS
INCLUDE('\CLARION\STD_KEYS') !COPY IN STD_KEYS
INCLUDE('\CLARION\ERRORS') !COPY IN CLARION ERROR CODES
OMIT('**-END-**')
! ┌───────────────────────────────────────────────────────────┐
! │ Modified 2-1-90 to allow for more appointment times, │
! │ for those of us who do not have Banker's Hours. │
! │ Report added for those not fortunate enough to receive │
! │ company lap tops. Also TAB Key feature added to jump │
! │ between time columns quickly. Path changed to \CAL . │
! │ │
! │ Dan Scott <Link Computer Systems> │
! └───────────────────────────────────────────────────────────┘
**-END-**
MAP !DEFINE MAP STRUCTURE
PROC(SHOW_CALNDAR)
PROC(GET_APPOINTS)
PROC(NOTES_FIELD)
PROC(GET_FILE)
.
MEMO_ROWS EQUATE(18) !SET UP EQUTES FOR MEMO FIELD
MEMO_COLS EQUATE(70)
MEMO_SIZE EQUATE(MEMO_ROWS * MEMO_COLS)
APPOINTS FILE,NAME(APPT_PTHNAME),CREATE,RECLAIM,PRE(APP) !DEFINE APPOINTMENT FILE
DATE_KEY KEY(APP:DATE) !KEEP A KEY IN DATE ORDER
COMMENTS MEMO(MEMO_SIZE) !DELCLARE A MEMO FIELD
DAILY RECORD
DATE LONG
GROUP,DIM(54) !SET UP AN ARRAY FOR EACH HALF
APPOINTMENT STRING(40) ! HOUR APPOINTMENT
.
AM BYTE ! NUMBER OF APPOINTMENTS IN AM
PM BYTE ! NUMBER OF APPOINTMENTS IN PM
. . ! END OF RECORD, END OF FILE
APPT_PTHNAME GROUP,PRE(ACT) !ACTIVE APPOINTMENT FILE
APPT_PATH STRING('\CAL\') !PATH FOR APPOINTMENT FILE(S)
APPT_NAME STRING(8) !FILENAME VARIABLE FOR APPOINTS
.
APPT_CTL FILE,NAME('\CAL\APPT_CTL'),PRE(CTL),RECLAIM
!MAINTAINS LIST OF APPOINTMENT
NAME_KEY KEY(CTL:NAME) ! FILES
FILE_REC RECORD
NAME STRING(8) !NAME OF FILE, 1ST 8 CHARACTERS
.. ! END OF RECORD, END OF FILE
EJECT
MAIN SCREEN PRE(MNU),HLP('MAIN'),HUE(8,0,0)
OMIT('**-END-**')
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╔════════════════════════════════════════╗▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ THE APPOINTMENT PARTNER ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╟────────────────────────────────────────╢░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ADD/CHANGE APPOINTMENTS ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ CHOOSE A PERSONAL SCHEDULE ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ EXIT ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║ ║░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╚════════════════════════════════════════╝░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
■■■■■■■■■■■■■■■■■■■■■■■■■
**-END-**
ROW(4,21) PAINT(3,40),HUE(15,1)
ROW(8,21) PAINT(12,40),HUE(1,2)
ROW(25,1) PAINT(1,80),HUE(14,6)
ROW(1,1) REPEAT(2);STRING('▒{80}'),HUE(8,0) .
ROW(3,1) STRING('▒{19}<0{42}>▒{19}'),HUE(8,0)
ROW(4,1) REPEAT(17);STRING('▒{19}<0{42}>░▒{18}'),HUE(8,0) .
ROW(21,1) STRING('▒{20}░{42}▒{18}'),HUE(8,0)
ROW(22,1) REPEAT(3);STRING('▒{80}'),HUE(8,0) .
ROW(3,20) STRING('╔═{40}╗'),HUE(15,4)
ROW(4,20) REPEAT(3);STRING('║<0{40}>║'),HUE(15,4) .
ROW(7,20) STRING('╟─{40}╢'),HUE(15,4)
ROW(8,20) REPEAT(12);STRING('║<0{40}>║'),HUE(15,4) .
ROW(20,20) STRING('╚═{40}╝'),HUE(15,4)
ROW(5,30) STRING('THE APPOINTMENT PARTNER')
ROW(25,29) MENU(@S25),USE(?CHOICE),HLP('MAIN'),SEL(14,6),REQ
CHOICE2 ROW(11,30) STRING('ADD/CHANGE APPOINTMENTS'),HUE(1,2) |
DESC(' SHOW APPOINTMENTS ')
CHOICE1 ROW(14,28) STRING('CHOOSE A PERSONAL SCHEDULE'),HUE(1,2) |
DESC('RETRIEVE OR CREATE A FILE')
CHOICE3 ROW(17,39) STRING('EXIT'),HUE(1,2),DESC(' END CALENDAR PROGRAM ')
. .
CODE
HELP('CALENDAR') !OPEN THE HELP FILE
OPEN(MAIN) !OPEN MAIN MENU SCREEN
LOOP
ALERT !CLEAR ALERT KEYS
ACCEPT !GET CHOICE
EXECUTE CHOICE()
SHOW_CALNDAR !SHOW THE CALENDAR SCREEN
GET_FILE !GET OR CREATE A FILE
RETURN !TERMINATE THE PROGRAM
..
EJECT('SHOW CALENDAR')
SHOW_CALNDAR PROCEDURE
CALENDAR SCREEN WINDOW(25,80),AT(1,1),PRE(CAL),HUE(14,0,0)
OMIT('**-END-**')
║ SUNDAY │ MONDAY │ TUESDAY │ WEDNESDAY│ THURSDAY │ FRIDAY │ SATURDAY ║
║ <# │ │ │ │ │ │ ║
║■■■■■■■■■■│ │ │ │ │ │ ║
║■■■■■■■■■■│ │ │ │ │ │ ║
╟──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────╢
■ ║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
╟──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────╢
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
╟──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────╢
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
╟──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────╢
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
╟──────────┼──────────┼──────────┼──────────┼──────────┼──────────┼──────────╢
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
║ │ │ │ │ │ │ ║
╚══════════╧══════════╧══════════╧╣■■■■■■■■╠╧══════════╧══════════╧══════════╝
**-END-**
ROW(2,4) PAINT(23,76),HUE(0,7)
ROW(1,3) REPEAT(4)
STRING('<186,0{10},179,0{10},179,0{10},179,0{10}>' |
& '<179,0{10},179,0{10},179,0{10},186>'),HUE(7,1) .
ROW(5,3) REPEAT(5),EVERY(4)
STRING('<199,196{10},197,196{10},197,196{10},197>' |
& '<196{10},197,196{10},197,196{10},197,196{10}>' |
& '<182>'),HUE(7,1) .
ROW(6,3) REPEAT(10),EVERY(2)
STRING('<186,0{10},179,0{10},179,0{10},179,0{10}>' |
& '<179,0{10},179,0{10},179,0{10},186>'),HUE(7,1) .
ROW(7,3) REPEAT(5),EVERY(4)
STRING('<186,0{10},179,0{10},179,0{10},179,0{10}>' |
& '<179,0{10},179,0{10},179,0{10},186>'),HUE(7,1) .
ROW(25,3) STRING('<200,205{10},207,205{10},207,205{10},207>' |
& '<0{10},207,205{10},207,205{10},207,205{10},188>')|
HUE(7,1)
COL(37) STRING('<185,0{8},204>'),HUE(7,1)
ROW(1,4) STRING(' SUNDAY '),HUE(15,1)
COL(15) STRING(' MONDAY '),HUE(15,1)
COL(26) STRING(' TUESDAY '),HUE(15,1)
COL(37) STRING(' WEDNESDAY'),HUE(15,1)
COL(48) STRING(' THURSDAY '),HUE(15,1)
COL(59) STRING(' FRIDAY '),HUE(15,1)
COL(70) STRING(' SATURDAY '),HUE(15,1)
REPEAT(14),INDEX(INDEX)
MONTH_YEAR ROW(6,1) STRING(1),ENH
.
REPEAT(6,7),EVERY(4,11),INDEX(INDEX)
ROW(2,4) POINT(3,10),USE(?INDEX),HLP('CALENDAR'),REQ
DAY COL(8) STRING(@N_2B)
AM ROW(3,4) STRING(10)
PM ROW(4,4) STRING(10)
.
APPT_NAME ROW(25,38) STRING(8)
.
DATE LONG !SELECTED DATE
MONTH LONG !SELECTED MONTH
DAY LONG !SELECTED DAY
YEAR LONG !SELECTED YEAR
MONTH_YEAR STRING(14) !SELECTED MONTH AND YEAR
MONTH_NAMES GROUP !NAMES OF THE MONTHS
STRING('JANUARY FEBRUARY MARCH APRIL ')
STRING('MAY JUNE JULY AUGUST ')
STRING('SEPTEMBEROCTOBER NOVEMBER DECEMBER ')
.
MONTH_NAME STRING(9),DIM(12),OVER(MONTH_NAMES) !ARRAY OF MONTH NAMES
TRNSFORM_TBL GROUP !THIS TABLE TRANSFORMS
STRING('<01,07,13,19,25,31,37>') ! COLUMN WITHIN ROW
STRING('<02,08,14,20,26,32,38>') ! SEQUENCE
STRING('<03,09,15,21,27,33,39>') ! INTO
STRING('<04,10,16,22,28,34,40>') ! ROW WITHIN COLUMN
STRING('<05,11,17,23,29,35,41>') ! SEQUENCE
STRING('<06,12,18,24,30,36,42>') !
. !
TRANSFORM BYTE,DIM(42)OVER(TRNSFORM_TBL) !REDECLARE AS A BYTE ARRAY
INDEX BYTE !REPEAT INDEX
SAVE_INDEX BYTE !SAVE AREA FOR REPEAT INDEX
BASE_COL LONG !LAST COLUMN OF LAST MONTH
BASE_DATE LONG !LAST DAY OF LAST MONTH
I BYTE !SUBSCRIPT USED FOR DAY
LAST_DAY BYTE !LAST CALENDAR DAY OF MONTH
CODE
IF ~ACT:APPT_NAME THEN GET_FILE. !IF FILE NOT SELECTED,GET ONE
SHARE(APPOINTS)
CLEAR(APP:DAILY)
SET(APP:DATE_KEY,APP:DATE_KEY)
LOOP UNTIL EOF(APPOINTS)
NEXT(APPOINTS)
IF APP:DATE < TODAY() - 31
DELETE(APPOINTS)
.
.
DATE = TODAY() !SELECT TODAY'S DATE
MONTH = MONTH(DATE) !SELECT TODAY'S MONTH
DAY = DAY(DATE) !SELECT TODAY'S DAY
YEAR = YEAR(DATE) !SELECT TODAY'S YEAR
INDEX = TRANSFORM[(DATE-DAY+1) % 7 + DAY] !SET REPEAT INDEX
OPEN(CALENDAR) !SHOW THE CALENDAR
CAL:APPT_NAME = CENTER(ACT:APPT_NAME) !DISPLAY ACTIVE FILE
LOOP !LOOP UNTIL CTRL-ESC KEY
SAVE_INDEX = INDEX !SAVE REPEAT INDEX
MONTH_YEAR = CLIP(MONTH_NAME[MONTH])&' '&YEAR!SET MONTH AND YEAR
LOOP INDEX = 1 TO 14 !SHOW THE MONTH AND YEAR
CAL:MONTH_YEAR = SUB(MONTH_YEAR,INDEX,1) !
.
BASE_DATE = DATE(MONTH,1,YEAR) - 1 !SET BASE DATE
BASE_COL = (BASE_DATE + 1) % 7 !SET BASE COLUMN
LAST_DAY = DAY(DATE(MONTH+1,1,YEAR) -1) !GET LAST DAY OF MONTH
LOOP I = 1 TO BASE_COL !CLEAR LEADING UNUSED BOXES
INDEX = TRANSFORM[I] ! FOR THE MONTH DISPLAYED
CAL:DAY = '' ! CLEAR SCREEN VARIABLE
CAL:AM = '' ! "
CAL:PM = '' ! "
.
LOOP I = (LAST_DAY + BASE_COL + 1) TO (42) !CLEAR TRAILING UNUSED BOXES
INDEX = TRANSFORM[I] ! FOR THE MONTH DISPLAYED
CAL:DAY = '' ! CLEAR SCREEN VARIABLE
CAL:AM = '' ! "
CAL:PM = '' ! "
.
LOOP I = 1 TO LAST_DAY !LOOP FOR EACH DAY OF MONTH
INDEX = TRANSFORM[I + BASE_COL] !SET REPEAT INDEX TO TODAY
CAL:DAY = I !SHOW THE DAY OF THE MONTH
APP:DATE = BASE_DATE + I !SET THE DATE FOR THIS DAY
CAL:AM = '' !CLEAR SCREEN VARIABLE
CAL:PM = '' !
GET(APPOINTS,APP:DATE_KEY) !READ THE APPOINTMENT RECORD
IF ~ERROR() !IF THERE IS A RECORD
IF APP:AM !SHOW COUNT OF AM APPOINTMENTS
CAL:AM = APP:AM & ' APPT AM'
CAL:AM = CENTER(CAL:AM)
.
IF APP:PM !SHOW COUNT OF PM APPOINTMENTS
CAL:PM = APP:PM & ' APPT PM'
CAL:PM = CENTER(CAL:PM)
. . .
INDEX = SAVE_INDEX !RESTORE REPEAT INDEX
LOOP
ALERT !CLEAR ALL ALERT KEYS
ALERT(CTRL_HOME) !CTRL-HOME RESETS CALENDAR
ALERT(CTRL_ESC) !CTRL-ESC TERMINATES CALENDAR
LOOP WHILE KEYBOARD();ASK.
ACCEPT !GET AN ALERTED KEY STROKE
CASE KEYCODE() !JUMP TO THE KEYSTROKE
OF ENTER_KEY !DAY WAS SELECTED
GET_APPOINTS(DATE(MONTH,CAL:DAY,YEAR)) ! GET APPOINTMENTS
CAL:AM = ''
CAL:PM = ''
IF APP:AM !SHOW COUNT OF AM APPOINTMENTS
CAL:AM = APP:AM & ' APPT AM'
CAL:AM = CENTER(CAL:AM)
.
IF APP:PM !SHOW COUNT OF PM APPOINTMENTS
CAL:PM = APP:PM & ' APPT PM'
CAL:PM = CENTER(CAL:PM)
.
CYCLE ! DO NOT REDISPLAY CALENDAR
OF CTRL_ESC !RETURN ON Ctrl-Esc KEY
RETURN
OF PGUP_KEY !LAST MONTH ON PgUp kEY
MONTH-=1
OF PGDN_KEY !NEXT MONTH ON PgDn KEY
MONTH+=1
OF CTRL_PGUP !LAST YEAR ON Ctrl-PgUp KEY
YEAR-=1
OF CTRL_PGDN !NEXT YEAR ON Ctrl-PgDn KEY
YEAR+=1
OF CTRL_HOME !TODAY ON Ctrl-Home KEY
DATE = TODAY() !SELECT TODAY'S DATE
MONTH = MONTH(DATE) !SELECT TODAY'S MONTH
DAY = DAY(DATE) !SELECT TODAY'S DAY
YEAR = YEAR(DATE) !SELECT TODAY'S YEAR
INDEX = TRANSFORM[(DATE-DAY+1) % 7 + DAY]!SET REPEAT INDEX TO TODAY
.
IF MONTH < 1 THEN YEAR-=1;MONTH=12. !CORRECT MONTH UNDERFLOW
IF MONTH > 12 THEN YEAR+=1;MONTH=1. !CORRECT MONTH OVERFLOW
BREAK !REDISPLAY THE CALANDER
. .
EJECT('GET APPOINTMENTS WINDOW')
GET_APPOINTS PROCEDURE(DATE)
APPOINT_WIN SCREEN WINDOW(25,80),AT(1,1),PRE(WIN),HLP('APPOINT'),HUE(14,4)
OMIT('**-END-**')
╔═══════════ APPOINTMENTS FOR ════════╤═══ ■■■■■■■■■■■■■■■■■■■■■■■■■■ ═════════╗
║ F1 Help mmm dd,yyyy │ ■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
║ ■■■■■■■■■ │ ■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
╟─────────────────────────────────────┴────────────────────────────────────────╢
║ ■■■■■ ■■■■■■■■■■■■■■■■■ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
║ ║
╟───────────────────────────────────── ────────────────────────────────────────╢
║ CTRL_ENTER to Save Appointments - CTRL_N to Edit Notes Window ║
╚══════════════════════════════════════════════════════════════════════════════╝
**-END-**
ROW(2,44) PAINT(2,1),HUE(1,2)
ROW(24,8) PAINT(1,63),HUE(14,1)
ROW(5,4) PAINT(18,23),HUE(15,6)
ROW(5,28) PAINT(18,24),HUE(15,6)
ROW(5,53) PAINT(18,24),HUE(15,6)
ROW(1,1) STRING('╔<0{3}>═{8}<0{18}>═{5}<0,0>═╤═══<0{37}>╗')
ROW(2,1) REPEAT(2);STRING('║<0{37}>│<0{40}>║') .
ROW(4,1) STRING('╟─{37}┴─{40}╢')
ROW(5,1) REPEAT(18);STRING('║<0{78}>║') .
ROW(23,1) STRING('╟─{37}<0>─{40}╢')
ROW(24,1) STRING('║<0{78}>║')
ROW(25,1) STRING('╚═{78}╝')
ROW(1,2) STRING('═══<0{31}>══<0{33}>═{9}'),ENH
COL(13) STRING(' APPOINTMENTS FOR'),HUE(14,4)
COL(43) STRING(' '),HUE(14,4)
COL(70) STRING(' '),HUE(14,4)
ROW(2,3) STRING('F1 Help'),HUE(14,4)
COL(40) STRING(' '),HUE(14,4)
ROW(3,40) STRING(' '),HUE(14,4)
ROW(5,2) STRING(' '),HUE(14,4)
COL(40) STRING(' '),HUE(15,6)
ROW(6,39) STRING(' '),HUE(15,6)
ROW(7,39) STRING(' '),HUE(15,6)
ROW(8,39) STRING(' '),HUE(15,6)
ROW(9,39) STRING(' '),HUE(15,6)
ROW(10,39) STRING(' '),HUE(15,6)
ROW(11,39) STRING(' '),HUE(15,6)
ROW(12,39) STRING(' '),HUE(15,6)
ROW(13,39) STRING(' '),HUE(15,6)
ROW(14,39) STRING(' '),HUE(15,6)
ROW(15,39) STRING(' '),HUE(15,6)
ROW(16,38) STRING(' '),HUE(15,6)
ROW(17,38) STRING(' '),HUE(15,6)
ROW(18,39) STRING(' '),HUE(15,6)
ROW(19,39) STRING(' '),HUE(15,6)
ROW(20,39) STRING(' '),HUE(15,6)
ROW(21,39) STRING(' '),HUE(15,6)
ROW(22,38) STRING(' '),HUE(15,6)
ROW(23,39) STRING(' '),HUE(14,4)
ROW(24,8) STRING(' '),HUE(14,4)
COL(10) STRING('CTRL_ENTER'),HUE(15,1)
COL(21) STRING('to Save Appointments'),ENH
COL(42) STRING('-'),HUE(15,1)
COL(44) STRING('CTRL_N'),HUE(15,1)
COL(51) STRING('to Edit Notes Windo'),ENH
COL(70) STRING('w'),HUE(14,1)
COL(71) STRING(' '),HUE(14,1)
DATE ROW(2,16) STRING(@D3)
DAY_NAME ROW(3,17) STRING(9)
NT1 ROW(1,44) STRING(26)
NT2 ROW(2,44) STRING(26)
NT3 ROW(3,44) STRING(26)
REPEAT(18,3),EVERY(1,25),INDEX(INDEX)
TIME ROW(5,4) STRING(5)
COL(10) ENTRY(@S17),USE(APP:APPOINTMENT),HUE(9,6),LFT
. .
DATE LONG !APPOINTMENT DATE
TIME LONG !APPOINTMENT TIME
ACTION BYTE !OLD RECORD = 1
!NEW RECORD = 2
INDEX BYTE !REPEAT INDEX
DAY_NAMES GROUP !NAMES OF DAYS
STRING(' SUNDAY MONDAY TUESDAY ')
STRING('WEDNESDAYTHURSDAY FRIDAY ')
STRING('SATURDAY ')
.
DAY_NAME STRING(9),DIM(7),OVER(DAY_NAMES) !ARRAY OF MONTH NAMES
REPORT REPORT WIDTH(80),PRE(RPT)
HEADER
COL(1) STRING('Date')
DATE COL(6) STRING(@D1)
COL(33) STRING('Appointment List')
ROW(+3,1) STRING('Time {5}Appointment') CTL(@LF2)
.
DETAIL DETAIL,PRE(RPT)
TIME COL(1) STRING(@T1)
APPT COL(10) STRING(40) CTL(@LF)
.
DETAIL
CTL(@LF)
. .
CODE
OPEN(APPOINT_WIN) !SHOW THE APPOINMENTS WINDOW
WIN:DATE = DATE !SHOW THE APPOINTMENT DATE
WIN:DAY_NAME = DAY_NAME[DATE%7+1] !SHOW THE APPOINTMENT DAY
TIME = 2880001 !START AT 8:00AM
LOOP INDEX = 1 TO 54 !SHOW THE APPOINTMENT TIMES
WIN:TIME = FORMAT(TIME,@T3) ! SHOW THE NEXT TIME
TIME += 90000 ! ADD 30 MINUTES
.
CLEAR(APP:DAILY) !CLEAR THE APPOINTMENT RECORD
CLEAR(APP:COMMENTS) !CLEAR THE MEMO FIELD
APP:DATE = DATE !SET THE RECORD KEY
GET(APPOINTS,APP:DATE_KEY) !READ THE RECORD
IF ERROR()
ACTION = 2 !RECORD IS NOT FOUND
ELSE
ACTION = 1 !RECORD IS FOUND
.
DO TELL_NOTES !ANY NOTES ?
LOOP INDEX = 1 TO 54 !SHOW APPOINTMENTS
DISPLAY(?APP:APPOINTMENT)
.
INDEX = 1 !POINT TO FIRST APPOINTMENT
LOOP !LOOP THROUGH ALL THE FIELDS
ALERT !CLEAR ALL ALERT KEYS
ALERT(CTRL_ESC) !CTRL-ESC QUITS WITHOUT CHANGES
ALERT(CTRL_ENTER) !CTRL-ENTER SAVES APPOINTMENTS
ALERT(CTRL_N) !CTRL_W BRINGS UP TEXT WINDOW
ALERT(F6_KEY)
ALERT(TAB_KEY)
LOOP WHILE KEYBOARD();ASK.
ACCEPT !GET A KEY
CASE KEYCODE()
OF F6_KEY ! ADDED 2-1-90
DO PRT_DAY ! PRINT DAYS APPTS
OF TAB_KEY ! JUMP 8 SLOTS AT A TIME
INDEX += 8 ! TO ACCOMODATE 3 COLUMNS
OF CTRL_ESC ! RETURN WITHOUT CHANGES
RETURN
OF CTRL_N ! OPEN TEXT WINDOW
NOTES_FIELD ! CALL PROCEDURE
DO TELL_NOTES ! ANY NOTES ?
OF CTRL_ENTER ! Save ON Ctrl-Enter
APP:AM = 0 ! INITIATE TALLIES FOR DAILY
APP:PM = 0 ! APPOINTMENTS
LOOP INDEX = 1 TO 54 ! MOVE OUT NOTES
UPDATE(?APP:APPOINTMENT) !
IF APP:APPOINTMENT[INDEX] ! IF AN APPOINTMENT WAS MADE
IF INDEX < 17 ! AND IN THE AM THEN
APP:AM += 1 ! INCREMENT AM TALLY
ELSE ! ELSE
APP:PM += 1 ! INCREMENT PM TALLY
. . .
EXECUTE ACTION ! UPDATE THE FILE
PUT(APPOINTS) ! PUT OLD RECORD
ADD(APPOINTS) ! ADD NEW RECORD
.
IF ERROR() THEN STOP(ERROR()). !CHECK FOR FILE ERROR
RETURN !CLOSE WINDOW & RETURN W/CHNGS
. .
TELL_NOTES ROUTINE
IF APP:COMMENTS
WIN:NT1 = ' There Are NOTES ' !SHOW MESSAGE TO INDICATE
WIN:NT2 = ' for This Date ' ! THAT THE COMMENTS FIELD
WIN:NT3 = ' Press Ctrl_N to View ' ! IS NOT BLANK
ELSE
WIN:NT1 = ' ' !SHOW MESSAGE TO INDICATE
WIN:NT2 = ' ' ! THAT THE COMMENTS FIELD
WIN:NT3 = ' No NOTES ' ! IS BLANK
.
PRT_DAY ROUTINE
RPT:DATE = DATE
OPEN(REPORT)
TIME = 2880001 !START AT 8:00AM
APP:DATE = DATE !SET THE RECORD KEY
LOOP INDEX = 1 TO 54 !SHOW THE APPOINTMENT TIMES
RPT:TIME = FORMAT(TIME,@T3) ! SHOW THE NEXT TIME
TIME += 90000 ! ADD 15 MINUTES
GET(APPOINTS,APP:DATE_KEY) !READ THE RECORD
RPT:APPT = APP:APPOINTMENT[INDEX]
PRINT(RPT:DETAIL)
.
CLOSE(REPORT) !SHOW APPOINTMENTS
EXIT
EJECT('GET NOTES WINDOW')
NOTES_FIELD PROCEDURE
NOTES_WINDOW SCREEN WINDOW(22,72),AT(3,4),HUE(14,4)
OMIT('**-END-**')
╔═NOTES════════════════════════════════════════════════════════════════╗
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
║■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■║
╚════╦════════════════════════╦══════════╦════════════════════════╦════╝
║Press Ctrl-Enter to Save║ ║Press Ctrl-Esc to Quit║
╚════════════════════════╝ ╚════════════════════════╝
**-END-**
ROW(21,7) PAINT(1,24),HUE(1,3)
ROW(21,43) PAINT(1,24),HUE(1,3)
ROW(1,1) STRING('<201,205,0{5},205{64},187>')
ROW(2,1) REPEAT(18);STRING('<186,0{70},186>') .
ROW(20,1) STRING('<200,205{4},203,205{24},203,205{10},203>' |
& '<205{24},203,205{4},188>')
ROW(21,6) STRING('<186,0{24},186,0{10},186,0{24},186>')
ROW(22,6) STRING('<200,205{24},188,0{10},200,205{24},188>')
ROW(1,3) STRING('NOTES')
ROW(21,7) STRING('Press Ctrl-Enter to Save')
COL(43) STRING('Press Ctrl-Esc to Quit')
ROW(2,2) TEXT(18,70),USE(COMMENTS),HUE(14,6),SEL(14,6),OVR,LFT
.
CODE
HELP(,'NOTES') !SELECT THE NOTES HELP WINDOW
OPEN(NOTES_WINDOW) !SHOW THE WINDOW
ALERT !CLEAR ALL ALERT KEYS
ALERT(CTRL_ESC) !CTRL-ESC ABORTS NOTES WINDOW
ALERT(CTRL_ENTER) !CTRL-ENTER SAVE NOTES
LOOP
ACCEPT !WAIT FOR ALERTED KEY
CASE KEYCODE()
OF CTRL_ESC !RETURN TO APPOINTMENT WINDOW
RETURN ! WITHOUT SAVING NOTES
OF CTRL_ENTER
UPDATE !SAVE NOTES
RETURN !RETURN TO APPOINTMENT WINDOW
..
EJECT('GET AN APPOINTMENT FILE')
GET_FILE PROCEDURE
CTL_LIST SCREEN WINDOW(25,68),PRE(LST),HLP('LIST'),HUE(7,1)
OMIT('**-END-**')
╔═════════════════════════════════╤════════════════════════════════╗
║ ┌────────┐ │ ║
║ │■■■■■■■■│ │ Type ║
║ │ │ Point │ In A New ║
║ │ │ To A │ Name Here ║
║ │ │ Name Here │ ┌────────┐ ║
║ │ │ │ │■■■■■■■■│ ║
║ │ │ │ └────────┘ ║
║ │ │ │ ║
║ │ │ │ ║
║ │ │ ┌─────┴─────┐ ║
║ │ │ │Active File│ ║
║ └────────┘ │ ■■■■■■■■ │ ║
╟───────────────────────────┴───────────┴──────────────────────────╢
║ Use the Up, Down Arrow Keys to Select a File from the ║
║ List on the Left, or Press Esc to Enter a Filename in ║
║ the space on the Right. ║
╟──────────────────────────────────────────────────────────────────╢
║ Press Enter to Activate Desired File(File will be CREATED ║
║ if Necessary). Press Ctrl_D to Delete the File From the ║
║ List and the DOS Directory. ║
╟──────────────────────────────────────────────────────────────────╢
║ Press Ctrl_Enter or Ctrl_Esc to Return. ║
║ (A File Must Be Active Before Returning.) ║
╚══════════════════════════════════════════════════════════════════╝
**-END-**
ROW(1,1) STRING('<201,205{33},209,205{32},187>')
ROW(2,1) STRING('<186,0{7},218,196{8},191,0{16},179,0{32}>' |
& '<186>')
ROW(3,1) REPEAT(3)
STRING('<186,0{7},179,0{8},179,0{16},179,0{32}>' |
& '<186>') .
ROW(6,1) STRING('<186,0{7},179,0{8},179,0{16},179,0{15},218>' |
& '<196{8},191,0{7},186>')
ROW(7,1) STRING('<186,0{7},179,0{8},179,0{16},179,0{15},179>' |
& '<0{8},179,0{7},186>')
ROW(8,1) STRING('<186,0{7},179,0{8},179,0{16},179,0{15},192>' |
& '<196{8},217,0{7},186>')
ROW(9,1) REPEAT(2)
STRING('<186,0{7},179,0{8},179,0{16},179,0{32}>' |
& '<186>') .
ROW(11,1) STRING('<186,0{7},179,0{8},179,0{10},218,196{5},193>'|
& '<196{5},191,0{26},186>')
ROW(12,1) STRING('<186,0{7},179,0{8},179,0{10},179,0{11},179>' |
& '<0{26},186>')
ROW(13,1) STRING('<186,0{7},192,196{8},217,0{10},179,0{11}>' |
& '<179,0{26},186>')
ROW(14,1) STRING('<199,196{27},193,196{11},193,196{26},182>')
ROW(15,1) REPEAT(5),EVERY(2);STRING('<186,0{66},186>') .
ROW(16,1) REPEAT(3),EVERY(4);STRING('<186,0{66},186>') .
ROW(18,1) REPEAT(2),EVERY(4);STRING('<199,196{66},182>') .
ROW(25,1) STRING('<200,205{66},188>')
ROW(3,52) STRING('Type')
ROW(4,21) STRING('Point')
COL(52) STRING('In A New')
ROW(5,21) STRING('To A')
COL(52) STRING('Name Here')
ROW(6,21) STRING('Name Here')
ROW(12,30) STRING('Active File')
ROW(15,8) STRING('Use the Up, Down Arrow Keys to Select a ' |
& 'File from the')
ROW(16,8) STRING('List on the Left, or Press Esc to Enter a ' |
& 'Filename in')
ROW(17,8) STRING('the space on the Right.')
ROW(19,7) STRING('Press Enter to Activate Desired File(File ' |
& 'will be CREATED')
ROW(20,7) STRING('if Necessary). Press Ctrl_D to Delete the' |
& ' File From the')
ROW(21,7) STRING('List and the DOS Directory.')
ROW(23,16) STRING('Press Ctrl_Enter or Ctrl_Esc to Return.')
ROW(24,15) STRING('(A File Must Be Active Before Returning.)')
REPEAT(10),INDEX(INDEX)
ROW(3,10) POINT(1,8),USE(?POINT),ESC(?ACT:APPT_NAME),REQ
NAME COL(10) STRING(8)
.
ROW(7,52) ENTRY(@S8),USE(ACT:APPT_NAME),OVR,LFT,UPR
SAVNAME ROW(13,31) STRING(8)
.
FILE_ERROR SCREEN WINDOW(5,34),PRE(FLR),HUE(7,4)
OMIT('**-END-**')
╔══FILE═ERROR════════════════════╗
║ ║
║ ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ║
║ ║
╚══════════════════Press═a═Key═══╝
**-END-**
ROW(1,1) STRING('<201,205{2},0{4},205,0{5},205{20},187>')
ROW(2,1) REPEAT(3);STRING('<186,0{32},186>') .
ROW(5,1) STRING('<200,205{18},0{5},205,0,205,0{3},205{3},188>')
ROW(1,4) STRING('FILE')
COL(9) STRING('ERROR')
ROW(5,20) STRING('Press')
COL(26) STRING('a')
COL(28) STRING('Key')
ERROR ROW(3,3) STRING(30),REV
.
EJECT
CREATE_WND SCREEN WINDOW(5,24),HUE(0,2)
OMIT('**-END-**')
╔══════════════════════╗
║ ║
║ CREATING A NEW FILE ║
║ ║
╚══════════════════════╝
**-END-**
ROW(1,1) STRING('<201,205{22},187>')
ROW(2,1) REPEAT(3);STRING('<186,0{22},186>') .
ROW(5,1) STRING('<200,205{22},188>')
ROW(3,3) STRING('CREATING A NEW FILE'),REV,BLK
.
INDEX BYTE
CODE
ALERT !CLEAR ALERT KEYS
ALERT(Ctrl_D) !DELETE A FILENAME ENTRY
ALERT(Ctrl_Enter) !RETURN
ALERT(Ctrl_Esc) !RETURN
CLOSE(APPOINTS) !CLOSE FILE IF OPEN
OPEN(CTL_LIST) !OPEN WINDOW
LST:SAVNAME = CENTER(ACT:APPT_NAME) !SHOW CURRENT ACTIVE FILE AND
! SAVE FOR REUSE
LOOP
SET(CTL:NAME_KEY) !PROCESS IN NAME ORDER
INDEX = 0 !SET REPEAT INDEX
LOOP UNTIL EOF(APPT_CTL) OR INDEX = 10 !GET ALL FILE NAMES(MAX OF TEN)
NEXT(APPT_CTL) !GET NEXT RECORD
INDEX += 1 !INCREMENT REPEAT INDEX
LST:NAME = CTL:NAME !SHOW FILE NAME
.
LOOP INDEX = INDEX + 1 TO 10 !CLEAR OUT UNUSED REPEAT
CLEAR(LST:NAME) ! STRINGS
.
ERASE(?ACT:APPT_NAME) !CLEAR ENTRY FIELD
INDEX = 1 !POINT TO FIRST ENTRY
IF LST:NAME THEN SELECT(?POINT). !SELECT LIST IF NOT EMPTY
ACCEPT !WAIT FOR KEY
CASE KEYCODE()
OF ENTER_KEY !SELECT OR CREATE A FILE
CASE FIELD()
OF ?POINT !GET NAME FROM LIST
ACT:APPT_NAME = LST:NAME !SET UP NAME FOR OPEN
OF ?ACT:APPT_NAME !GET NAME FROM USER
IF ~ACT:APPT_NAME OR RECORDS(APPT_CTL) > 9 !IF LEFT BLANK
BEEP ! OR NO ROOM THEN CYCLE
CYCLE
. .
DO CREATE_FILE !GO OPEN FILE, CREATE IF NEEDED
OF Ctrl_D !DELETE A FILE
IF FIELD() = ?POINT !GET NAME FROM LIST
ACT:APPT_NAME = LST:NAME !SET UP NAME FOR DELETE
DO DELETE_FILE !AND DELETE IT
ELSE
BEEP !CAN ONLY DELETE FROM LIST
.
OF Ctrl_Enter OROF Ctrl_Esc !RETURN TO CALLER
IF ~LST:SAVNAME THEN CYCLE. !IF NO 'ACTIVE' FILE THEN CYCLE
ACT:APPT_NAME = LEFT(LST:SAVNAME) !RESET FILENAME
RETURN !
..
CREATE_FILE ROUTINE !OPEN OR CREATE NEW FILE
CLOSE(APPOINTS) !CLOSE ANY ACTIVE FILE
SHARE(APPOINTS) !ATTEMPT TO OPEN
IF ERROR() !IF NOT SUCCESSFUL
IF ERRORCODE() = NOFILE_ERR !AND FILE NOT FOUND
OPEN(CREATE_WND) ! DISPLAY A MESSAGE
CREATE(APPOINTS) ! THEN CREATE NEW FILE
IF ERROR() ! SHOW CREATE ERROR
DO SHOW_ERROR ! IF NECESSARY
CLOSE(CREATE_WND) ! CLOSE WINDOW
EXIT ! TRY AGAIN
.
CTL:NAME = LEFT(ACT:APPT_NAME) ! SETUP TO PUT IN APPT_CTL FILE
ADD(APPT_CTL) ! ADD NEW FILENAME TO APPT_CTL
IF ERROR() THEN DO SHOW_ERROR. ! SHOW ADD ERROR IF NEEDED
CLOSE(CREATE_WND) ! CLOSE WINDOW
ELSE
DO SHOW_ERROR ! ELSE SHOW OPEN ERROR
EXIT ! TRY AGAIN
. .
LST:SAVNAME = CENTER(ACT:APPT_NAME) ! DISPLAY NEW ACTIVE FILE
DELETE_FILE ROUTINE !DELETE THE APPOINTMENT FILE
IF ACT:APPT_NAME = LEFT(LST:SAVNAME) !IF DELETING CURRENT ACTIVE
CLEAR(LST:SAVNAME) ! FILE CLEAR STRING ON SCREEN
.
CLOSE(APPOINTS) !CLOSE FILE SO THAT IT CAN BE
SHARE(APPOINTS) !TESTED BY OPENING FOR AN
IF ERROR() !ERROR, IF THERE IS ONE THEN
DO SHOW_ERROR !DISPLAY IT AND DO NOT DELETE
!THE FILE FROM THE DISK
ELSE ! IF NO ERROR THEN DELETE FILE
CLOSE(APPOINTS) !MUST CLOSE FILE BEFORE REMOVE
REMOVE(APPOINTS) !REMOVE FILE FROM DISK
.
CTL:NAME = ACT:APPT_NAME !SETUP TO DELETE FROM APPT_CTL
GET(APPT_CTL,NAME_KEY) !DELETE THE APPT_CTL ENRTY
IF ~ERROR() THEN DELETE(APPT_CTL). ! FOR THE FILE
SHOW_ERROR ROUTINE !DISPLAY OPEN AND CREATE ERROR
OPEN(FILE_ERROR) !OPEN WINDOW
FLR:ERROR = ERROR() !DISPLAY ERROR
FLR:ERROR = CENTER(FLR:ERROR) !CENTER ERROR
ASK !WAIT FOR ANY KEY
CLOSE(FILE_ERROR) !CLOSE WINDOW