Go to the first, previous, next, last section, table of contents.


Resource file examples

Here are some examples of problem oriented resource files which might be useful to get a deeper impression about the attributes of Gcal's fixed date feature.

Let's begin with a common example:

; This is general example of a resource file.
;
19940715 Time: %t --> Dentist at 10:00
00000921 My %b1962 birthday%i1952#2062
0000093 Gregorian~Reformation\~is %y1752 year ago
0000Sep03 Gregorian~Reformation\~is %y1752 year ago
0 Every day in every month in every year
0000 Every day in every month in every year
00000000 Every day in every month in every year
199400fri        Every Friday in 1994
000007mo3 Every third Monday~in July every year less 1980%i#1979
0000@e-10 Easter Sunday-10 days every year
0@e-10 Easter Sunday-10 days every year
00000000@e+10 Easter Sunday+10 days every year
a=1127
0@a+20 20 days after date of date variable `a'
a=*W10FR
0@a-1 The Thursday of the 10th ISO-week every year
0@a   The Friday of the 10th ISO-week every year
0@a1  The Saturday of the 10th ISO-week every year
1995*d10    The 10th absolute day in 1995
1995*d99tue The last Tuesday in 1995
0*w99su The Sunday of the last ISO-week every year
;
; Next entry is respected by ALL fixed date period modifiers.
;
1994*d1sun#99SUN.7 Each Sunday in 1994 
;
; Day of Prayer & Repentance is Wednesday before the Sunday,
;   which is before the 1st Advent's Sunday.
;
a=1225
a=a-5sun
0@a-4 Day of Prayer & Repentance
; or
0@a-1wed Day of Prayer & Repentance

And here is a resource file by the name of `demo3.rc', used to detect all Fridays the 13th of a year:

$a=Friday the 13th%i0000
$b=#0000
$c=fri2
$d=fri3
00000113 $a01$c$b01$c
00000113 $a01$d$b01$d
00000213 $a02$c$b02$c
00000213 $a02$d$b02$d
00000313 $a03$c$b03$c
00000313 $a03$d$b03$d
00000413 $a04$c$b04$c
00000413 $a04$d$b04$d
00000513 $a05$c$b05$c
00000513 $a05$d$b05$d
00000613 $a06$c$b06$c
00000613 $a06$d$b06$d
00000713 $a07$c$b07$c
00000713 $a07$d$b07$d
00000813 $a08$c$b08$c
00000813 $a08$d$b08$d
00000913 $a09$c$b09$c
00000913 $a09$d$b09$d
00001013 $a10$c$b10$c
00001013 $a10$d$b10$d
00001113 $a11$c$b11$c
00001113 $a11$d$b11$d
00001213 $a12$c$b12$c
00001213 $a12$d$b12$d

The result for the years 1996...2002 is as follows:

$ gcal -H no -u -x -f ./demo3.rc 1996+2002
-|
-| Fri, Sep  13th 1996: Friday the 13th
-| Fri, Dec  13th 1996: Friday the 13th
-|
-| Fri, Jun  13th 1997: Friday the 13th
-|
-| Fri, Feb  13th 1998: Friday the 13th
-| Fri, Mar  13th 1998: Friday the 13th
-| Fri, Nov  13th 1998: Friday the 13th
-|
-| Fri, Aug  13th 1999: Friday the 13th
-|
-| Fri, Oct  13th 2000: Friday the 13th
-|
-| Fri, Apr  13th 2001: Friday the 13th
-| Fri, Jul  13th 2001: Friday the 13th
-|
-| Fri, Sep  13th 2002: Friday the 13th
-| Fri, Dec  13th 2002: Friday the 13th

Or a bit shorter version of the resource file `demo3.rc' by the name of `demo4.rc', likewise used to detect all Fridays the 13th of a year, and that by using the fact, that a Friday the 13th only occurs if the first day of a month is a Sunday:

$a=%n+12 is a Friday%i0000
$b=#0000
$c=sun1
00000101 $a01$c$b01$c
00000201 $a02$c$b02$c
00000301 $a03$c$b03$c
00000401 $a04$c$b04$c
00000501 $a05$c$b05$c
00000601 $a06$c$b06$c
00000701 $a07$c$b07$c
00000801 $a08$c$b08$c
00000901 $a09$c$b09$c
00001001 $a10$c$b10$c
00001101 $a11$c$b11$c
00001201 $a12$c$b12$c

The result for the years 1996...2002 is as follows:

$ gcal -H no -u -x -f ./demo4.rc 1996+2002
-|
-| Sun, Sep   1st 1996: 13-Sep-1996 is a Friday
-| Sun, Dec   1st 1996: 13-Dec-1996 is a Friday
-|
-| Sun, Jun   1st 1997: 13-Jun-1997 is a Friday
-|
-| Sun, Feb   1st 1998: 13-Feb-1998 is a Friday
-| Sun, Mar   1st 1998: 13-Mar-1998 is a Friday
-| Sun, Nov   1st 1998: 13-Nov-1998 is a Friday
-|
-| Sun, Aug   1st 1999: 13-Aug-1999 is a Friday
-|
-| Sun, Oct   1st 2000: 13-Oct-2000 is a Friday
-|
-| Sun, Apr   1st 2001: 13-Apr-2001 is a Friday
-| Sun, Jul   1st 2001: 13-Jul-2001 is a Friday
-|
-| Sun, Sep   1st 2002: 13-Sep-2002 is a Friday
-| Sun, Dec   1st 2002: 13-Dec-2002 is a Friday

Of course, preceding textual expense for the purpose of detecting all Fridays the 13th of a year can be dramatically reduced by simply using of

0*d1fri#99fri.7 Friday the 13th%i00000013#00000013

in the resource file `demo3.rc', respectively,

0*d1sun#99sun.7 n+12 is a Friday%i00000001#00000001

in the `demo4.rc' resource file.

On the one hand, preceding one-liners reduce the coding expense quite considerably -- from 28 respectively 15 lines to 1 line in each case ---, but on the other hand, this partly increases the checking expense of these one-liners considerably and results to a longer program run-time therefore. Both one-liners produce about 52 internal productions respectively effective fixed date entries of themselves for each year checked by Gcal, at which the `demo3.rc' and `demo4.rc' resource files cause 24 respectively 12 effective fixed date entries only.

And here is a resource file by the name of `demo5.rc', used to detect all work days of any month:

$a=%VWork day
$c=%i#0000$b99
a=$bmon1
0@a#+4 $a
a=$btue1
0@a#+3 $a
a=$bwed1
0@a#+2 $a
a=$bthu1
0@a#+1 $a
a=$bfri1
0@a $a
a=$bmon2
0@a#+4 $a
a=$bmon3
0@a#+4 $a
a=$bmon4
0@a#+4 $a$c
a=$bmon9
0@a#+4 $a$c

Respectively a bit shorter version of the resource file `demo5.rc':

$a=%VWork day
$c=%i#0000$b99
0000$bmon1:5 $a
0000$btue1:4 $a
0000$bwed1:3 $a
0000$bthu1:2 $a
0000$bfri1:1 $a
0000$bmon2:5 $a
0000$bmon3:5 $a
0000$bmon4:5 $a$c
0000$bmon9:5 $a$c

And a resource file by the name of `include.rc' exists which is only used to include one given resource file:

#include "$f"

Then the result for the month August 1996 is as follows:

$ gcal -H no -u -x -r '$b=08:$f=demo5.rc' -f ./include.rc Aug 1996
-|
-| Thu, Aug   1st 1996: Work day
-| Fri, Aug   2nd 1996: Work day
-| Mon, Aug   5th 1996: Work day
-| Tue, Aug   6th 1996: Work day
-| Wed, Aug   7th 1996: Work day
-| Thu, Aug   8th 1996: Work day
-| Fri, Aug   9th 1996: Work day
-| Mon, Aug  12th 1996: Work day
-| Tue, Aug  13th 1996: Work day
-| Wed, Aug  14th 1996: Work day
-| Thu, Aug  15th 1996: Work day
-| Fri, Aug  16th 1996: Work day
-| Mon, Aug  19th 1996: Work day
-| Tue, Aug  20th 1996: Work day
-| Wed, Aug  21st 1996: Work day
-| Thu, Aug  22nd 1996: Work day
-| Fri, Aug  23rd 1996: Work day
-| Mon, Aug  26th 1996: Work day
-| Tue, Aug  27th 1996: Work day
-| Wed, Aug  28th 1996: Work day
-| Thu, Aug  29th 1996: Work day
-| Fri, Aug  30th 1996: Work day

And of course, the preceding textual expense for the purpose of detecting all work days of any month can be dramatically reduced by simply using of

00000001#0099 %V%rWork day

in the resource file `demo5.rc'.

And finally a resource file by the name of `swtime.rc' which results fixed date messages for the change of daylight-saving time valid since 1980 for the Federal Republic of Germany (61).

;
; `swtime.rc'; daylight-saving time BRD
;
$a=daylight-saving time starts Sunday
;
a=03sun9
0@a-2#+2 Summer $a~+1 hrs. (02:00 --> 03:00 h.)%i1980
;
a=09sun9
0@a-2#+2 Winter $a~-1 hrs. (03:00 --> 02:00 h.)%i1980#1995
;
a=10sun9
0@a-2#+2 Winter $a~-1 hrs. (03:00 --> 02:00 h.)%i1996


Go to the first, previous, next, last section, table of contents.