home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK5
/
DOS_01
/
4DUM12.ZIP
/
4CAL15.BTM
next >
Wrap
Text File
|
1990-11-06
|
8KB
|
210 lines
:***************************************************************************
:
:Name: 4Cal15.BTM (4DOS 3.01 required) Timestamp: 12-01-90 09:54pm
: Copyright (c) 1990, Dick Botbyl CIS 71571,151
:
:Description: Shows calendar on screen
:
:***************************************************************************
:START
@echo off
setlocal^UNSET *^UNALIAS *
*set _ccol=%@eval[(%_columns-80)/2]
*set mon_num=%@substr[%_DATE,0,2]
*set _day=%@substr[%_DATE,3,2]
*set _short_yr=%@substr[%_DATE,6,2]
*set _long_yr=%@eval[%_short_yr+1900]
*set _BClr=cya on blu
:Put up the calendar form
screen 1 1
drawbox 5 %@eval[%_ccol+24] 22 %@eval[%_ccol+59] 1 bla on bla fill bla
drawbox 4 %@eval[%_ccol+22] 21 %@eval[%_ccol+57] 1 %_BClr fill blu
drawbox 7 %@eval[%_ccol+22] 19 %@eval[%_ccol+57] 1 %_BClr fill blu
scrput 4 %@eval[%_ccol+35] bri yel on blu ` Calendar `
scrput 6 %@eval[%_ccol+22] %_BClr │ Mon Tue Wed Thu Fri Sat Sun │
scrput 20 %@eval[%_ccol+22] %_BClr │ Arrow keys change months [Esc] │
:BEGIN_TO :WHICH CALENDAR TYPE NEEDED
IFF %_short_yr LT 72 THEN
*set _short_yr=%@eval[%_short_yr +28]
GOTO BEGIN_TO
ENDIFF
IFF %_short_yr GT 99 THEN
*set _short_yr=%@eval[%_short_yr -28]
GOTO BEGIN_TO
ENDIFF
IF %_short_yr EQ 72 *set mon_type=13
IF %_short_yr EQ 73 *set mon_type= 1
IF %_short_yr EQ 74 *set mon_type= 2
IF %_short_yr EQ 75 *set mon_type= 3
IF %_short_yr EQ 76 *set mon_type=11
IF %_short_yr EQ 77 *set mon_type= 7
IF %_short_yr EQ 78 *set mon_type= 8
IF %_short_yr EQ 79 *set mon_type= 1
IF %_short_yr EQ 80 *set mon_type= 9
IF %_short_yr EQ 81 *set mon_type= 4
IF %_short_yr EQ 82 *set mon_type= 5
IF %_short_yr EQ 83 *set mon_type= 6
IF %_short_yr EQ 84 *set mon_type=14
IF %_short_yr EQ 85 *set mon_type= 2
IF %_short_yr EQ 86 *set mon_type= 3
IF %_short_yr EQ 87 *set mon_type= 4
IF %_short_yr EQ 88 *set mon_type=12
IF %_short_yr EQ 89 *set mon_type= 7
IF %_short_yr EQ 90 *set mon_type= 1
IF %_short_yr EQ 91 *set mon_type= 2
IF %_short_yr EQ 92 *set mon_type=10
IF %_short_yr EQ 93 *set mon_type= 5
IF %_short_yr EQ 94 *set mon_type= 6
IF %_short_yr EQ 95 *set mon_type= 7
IF %_short_yr EQ 96 *set mon_type= 8
IF %_short_yr EQ 97 *set mon_type= 3
IF %_short_yr EQ 98 *set mon_type= 4
IF %_short_yr EQ 99 *set mon_type= 5
:WHAT MONTH AND HOW MANY DAYS
*set _num_days= 31
IFF %mon_num EQ 01 THEN
*set _mon_str=January
*set _start_day= 1
ENDIFF
IFF %mon_num EQ 02 THEN
*set _start_day= 4
*set _num_days= 28
*set _mon_str=February
ENDIFF
IFF %mon_num EQ 03 THEN
*set _mon_str=March
*set _start_day= 4
ENDIFF
IFF %mon_num EQ 04 THEN
*set _num_days= 30
*set _mon_str=April
*set _start_day= 7
ENDIFF
IFF %mon_num EQ 05 THEN
*set _mon_str=May
*set _start_day= 2
ENDIFF
IFF %mon_num EQ 06 THEN
*set _num_days= 30
*set _mon_str=June
*set _start_day= 5
ENDIFF
IFF %mon_num EQ 07 THEN
*set _mon_str=July
*set _start_day= 7
ENDIFF
IFF %mon_num EQ 08 THEN
*set _mon_str=August
*set _start_day= 3
ENDIFF
IFF %mon_num EQ 09 THEN
*set _num_days= 30
*set _mon_str=September
*set _start_day= 6
ENDIFF
IFF %mon_num EQ 10 THEN
*set _mon_str=October
*set _start_day= 1
ENDIFF
IFF %mon_num EQ 11 THEN
*set _num_days= 30
*set _mon_str=November
*set _start_day= 4
ENDIFF
IFF %mon_num EQ 12 THEN
*set _mon_str=December
*set _start_day= 6
ENDIFF
*set _e_val=%@eval[(%_num_days-22)*5]
*set _f_val=%@eval[(%_num_days-29)*5]
*set _xcal=`│ │ │ │ │ │ │ │`
*set _zcal=`│ │ │ │`
*set _acal=`│ │ │ │ │ │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │`
*set _bcal=`│ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │`
*set _ccal=`│ 9 │ 10 │ 11 │ 12 │ 13 │ 14 │ 15 │ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │`
*set _dcal=`│ 16 │ 17 │ 18 │ 19 │ 20 │ 21 │ 22 │ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │`
*set _ecal=`│ 23 │ 24 │ 25 │ 26 │ 27 │ 28 │ 29 │ 30 │ 31 │`
*set _fcal=`│ 30 │ 31 │`
*set _ecal=%@substr[%_ecal,0,%_e_val]
*set _fcal=%@substr[%_fcal,0,%_f_val]
:WHERE TO PUT FIRST DAY
IFF %mon_type GT 7 THEN
IF %mon_num GT 2 *set _start_day=%@eval[%_start_day + 1]
ENDIFF
IF %mon_type GT 7 *set mon_type=%@eval[%mon_type -7]
*set _start_day=%@eval[%_start_day+%mon_type]
*set _start_day=%@eval[%_start_day- 1]
IF %_start_day GT 7 **set _start_day=%@eval[%_start_day - 7]
*set strt_ln= 8
*set start_day_out=%@eval[35-(%_start_day*5)]
IF %start_day_out GT 34 *set start_day_out=0
:PUT_WEEKS
scrput 8 %@eval[%_ccol+22] %_BClr %@substr[%_acal,%start_day_out,37]
scrput 10 %@eval[%_ccol+22] %_BClr %@substr[%_bcal,%start_day_out,37]
scrput 12 %@eval[%_ccol+22] %_BClr %@substr[%_ccal,%start_day_out,37]
scrput 14 %@eval[%_ccol+22] %_BClr %@substr[%_dcal,%start_day_out,37]
scrput 16 %@eval[%_ccol+22] %_BClr %_xcal
scrput 18 %@eval[%_ccol+22] %_BClr %_zcal
scrput 16 %@eval[%_ccol+22] %_BClr %@substr[%_ecal,%start_day_out,37]
IFF "%@substr[%_fcal,%start_day_out,37]" NE "" THEN
scrput 18 %@eval[%_ccol+22] %_BClr %@substr[%_fcal,%start_day_out,37]
ENDIFF
*set start_day_out=%@eval[(%_start_day*5)+14+5*%_day]
:PUT_DAY :PUT TODAY ON CALENDAR
IFF %start_day_out GT 58 THEN
*set start_day_out= %@eval[%start_day_out - 35]
*set strt_ln= %@eval[%strt_ln +2]
GOTO PUT_DAY
ENDIFF
IFF %_day LT 10 THEN
*set _day=%@substr[%_DATE,4,1]
*set start_day_out= %@eval[%start_day_out + 1]
ENDIFF
*set start_day_out= %@eval[%start_day_out + %_ccol]
scrput %strt_ln %start_day_out bri gre on blu %_day
:PUTLINES
drawbox 7 %@eval[%_ccol+27] 19 %@eval[%_ccol+32] 1 %_BClr
drawbox 7 %@eval[%_ccol+37] 17 %@eval[%_ccol+42] 1 %_BClr
drawbox 7 %@eval[%_ccol+47] 17 %@eval[%_ccol+52] 1 %_BClr
scrput 17 %@eval[%_ccol+22] %_BClr ├────┼────┼────┴────┴────┴────┴────┤
drawbox 18 %@eval[%_ccol+36] 18 %@eval[%_ccol+56] 0 %_BClr
scrput 18 %@eval[%_ccol+37] bri gre on blu %_mon_str
scrput 18 %@eval[%_ccol+48] bri gre on blu %_long_yr
drawbox 9 %@eval[%_ccol+22] 11 %@eval[%_ccol+57] 1 %_BClr
drawbox 11 %@eval[%_ccol+22] 13 %@eval[%_ccol+57] 1 %_BClr
drawbox 13 %@eval[%_ccol+22] 15 %@eval[%_ccol+57] 1 %_BClr
drawbox 15 %@eval[%_ccol+22] 17 %@eval[%_ccol+57] 1 %_BClr
drawbox 19 %@eval[%_ccol+23] 19 %@eval[%_ccol+56] 1 %_BClr
:SWITCH :LOOK AT DIFFERENT MONTH
inkey %%Key_code > nul
IF %Key_code EQ @71 GOTO START
IF %Key_code EQ @77 *set mon_num=%@eval[%mon_num+1]
IFF %mon_num GT 12 THEN
*set mon_num=1
*set _long_yr=%@eval[%_long_yr+1]
ENDIFF
IF %Key_code EQ @75 *set mon_num=%@eval[%mon_num-1]
IFF %mon_num LT 1 THEN
*set mon_num=12
*set _long_yr=%@eval[%_long_yr-1]
ENDIFF
IF %Key_code EQ @72 *set _long_yr=%@eval[%_long_yr+1]
IF %Key_code EQ @80 *set _long_yr=%@eval[%_long_yr-1]
IF %Key_code EQ @73 *set _long_yr=%@eval[%_long_yr+5]
IF %Key_code EQ @81 *set _long_yr=%@eval[%_long_yr-5]
IF "%Key_code" EQ "" GOTO FINI
IF %mon_num LT 10 **set mon_num=0%mon_num
*set _short_yr=%@eval[%_long_yr-1900]
UNSET Key_code mon_type start_day_out _start_day
screen 1 1
GOTO BEGIN_TO
:FINI
endlocal
screen 1 1