home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
dsy2kcal.zip
/
Calendar_2000
(
.txt
)
Wrap
DeScribe Document
|
1997-04-02
|
20KB
|
159 lines
DeScribe Copyright DeScribe, Inc., 1988, 1989
Letter
<none>
<none>
HPLaserJ
HPLaserJ
LASERJET
HP LaserJet 5/5M
HP LaserJet 5/5M
Letter
Black
White
Letter
00 READY
Custom Watermark
Info 1
Info 2
Info 3
Info 4
Macro
Courier
Courier New
! This macro prompts the user for a month and a year,
! calls up the Calendar Layout and fills in the headings
! with appropriate values.
VAR month
VAR day
VAR year
VAR yearstring
VAR noDays
VAR daySeq
VAR mo
VAR count
PROCEDURE DaysInMonth
! arguments are m and y, returns d
SET d TO 31
IF m=1 THEN SET mo TO "JANUARY" RETURN END IF
IF m=3 THEN SET mo TO "MARCH" RETURN END IF
IF m=5 THEN SET mo TO "MAY" RETURN END IF
IF m=7 THEN SET mo TO "JULY" RETURN END IF
IF m=8 THEN SET mo TO "AUGUST" RETURN END IF
IF m=10 THEN SET mo TO "OCTOBER" RETURN END IF
IF m=12 THEN SET mo TO "DECEMBER" RETURN END IF
SET d TO 30
IF m=4 THEN SET mo TO "APRIL" RETURN END IF
IF m=6 THEN SET mo TO "JUNE" RETURN END IF
IF m=9 THEN SET mo TO "SEPTEMBER" RETURN END IF
IF m=11 THEN SET mo TO "NOVEMBER" RETURN END IF
SET mo TO "FEBRUARY"
SET z TO year MOD 4
IF z = 0 THEN
SET d to 29
ELSE
SET d TO 28
END IF
END PROCEDURE
PROCEDURE CheckMon
! Call with: month=month
! year=year
! Exits with: noDays=no. of days in month
! monthName=text of month name
! daySeq=first day (0=Sun, 1=Mon, ..., 6=Sat)
SET count TO year * 365
SET q TO year - 1
SET q TO q / 4
SET count TO count + q
SET m TO 1
SET y TO year
REPEAT
EXIT WHEN m = month
CALL DaysInMonth
SET count TO count + d
SET m TO m + 1
END REPEAT
SET x TO count+1
SET z TO x MOD 7
SET daySeq TO z
SET m TO month
CALL DaysInMonth
SET noDays TO d
END PROCEDURE
MACRO Calendar
SET MacroDialogTitle to
Set up Calendar
MSET "Month (1-12)" TOVALUE month
MSET "Year (94, for example)" TOVALUE year
MGET
To create a Calendar table in a new DeScribe document, type the desired month and year.
IF month < 1 THEN QUIT END IF
IF month > 12 THEN QUIT END IF
!year should be 0 through 99
IF year < 0 THEN QUIT END IF
IF year > 99 THEN QUIT END IF
!all years less than 90 will be 2000+
IF year < 90 THEN SET year TO year + 100 END IF
!must use string constant since we
re crossing millenia boundaries,
! i.e. simple constant plus addition won
t work here.
CONVERT year + 1900 TOSTRING yearstring
CALL CheckMon
NewDocumentFile "CALENDAR"
SET SelectedFrame TO
CursorHome
PUT mo
PUT " "
KeyTab
PUT yearstring
CursorEndLine
CursorEndLine
CursorEndLine
CursorEndLine
CursorEndLine
CursorEndLine
CursorEndLine
TableCellRight
REPEAT
EXIT WHEN daySeq = 0
TableCellRight
SET daySeq TO daySeq - 1
END REPEAT
SET d TO 1
REPEAT
PUT d
EXIT WHEN d = noDays
SET d TO d + 1
TableCellRight
END REPEAT
TableModifyStart
SET TableTabCreateRows TO FALSE
TableProcessChanges
CursorHome
SET SelectedFrame TO
DeNote
END MACRO
DeScribe Glossary
Create date
Create time
Document name
File name
Pages
Pages (Alphabetic lower case)
Pages (Alphabetic upper case)
Pages (Roman lower case)
Pages (Roman upper case)
Print date
Print time
Revisions
Save date
Save time
August 4, 1994
12:31 P.M.
Calendar_2000
E:\DeScribe\Macros\Calendar_2000
April 2, 1997
3:23 P.M.
April 2, 1997
3:26 P.M.