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


Text part of a line

The text part of a line in a resource file can be any text you like. Indeed, some characters have a special meaning (`%', `$', `~', `^' and `\') and must be protected should the occasion arise that special character combinations are formed with them (43) which might be used only textually. If the text part contains characters that are used for highlighting the text or format it for a printer, or characters with decimal values above 127 in the code table of the used character set (44) not produced by Gcal itself, such characters respectively sequences are displayed by Gcal in an uninterpreted manner! For that very reason, it can happen that the output of such characters can potentially create problems with the used screen device driver software and/or the external pager program, likewise mailing of such texts by means of electronic mail.

So-called NUL characters (45) may also occur in the text part, but their effect is only the suppression of all succeeding characters of the line. In my opinion, it makes no perceptible sense to output these NUL characters uninterpreted, so they are used for remarking purposes only; besides, the NUL characters would cause the same problems already mentioned above.

A line of the resource file is continued on the next line if a `\-\n' (backslash-newline) character sequence is found, e.g.:

The line:

000000Mo Every Monday

and the lines:

000000Mo \
Every \
Monday

produce the same output and are essentially equivalent.

Furthermore, you can break up the text of a long text part at any place you like. The term long means in this context, that the text displayed by Gcal would override the right text margin of the screen respectively break up at that margin.

Each time a `~' (tilde) character is found in the text part, this character is replaced by a real `\n' (newline) character. Such texts will be displayed by Gcal in a formatted manner at a left margin --- this means, they are lead by a definite number of space characters.

You may depreciate the special meaning of the `~' (tilde) character --- in case this character itself is needed -- by placing a `\' (backslash) character before it, e.g. `\~'. If you need the `\~' characters themselves, you have to protect the `\' (backslash) character by itself, e.g. `\\~'.

Each time a `^' (caret) character is found in the text part, this character is also replaced by a real `\n' (newline) character. Such texts will be displayed by Gcal at column 1, -- this means, they are not lead by space characters. The rules for protecting the `^' character are the same as the rules used for protecting the `~' character.

The resource file `example.rc'

;
; Hi, I'm `example.rc' and alive now
;
0 I know I'm a short text
0 I hope I'm long enough~here, a line break up\
~and again~and now for the last time...
0 I hope I'm also long enough^here, a line break up\
~and again^and now for the last time...
0 Am I another short text? Dunno...

is displayed as follows:

$ gcal --resource-file=example.rc --disable-highlighting
-|
-| Fixed date list:
-|
-| Wed, Sep  14th 1994: Am I another short text? Dunno...
-| Wed, Sep  14th 1994: I hope I'm also long enough
-| here, a line break up
-|                      and again
-| and now for the last time...
-| Wed, Sep  14th 1994: I hope I'm long enough
-|                      here, a line break up
-|                      and again
-|                      and now for the last time...
-| Wed, Sep  14th 1994: I know I'm a short text

Because whitespace characters are used to separate the date part from the text part (46), it's not possible to supply the text part with leading whitespace characters without further ado. If one or more whitespace characters shall lead the text part, this can be arranged by protecting the first of these whitespace characters (and that by placing a `\' (backslash) character before it), e.g. `\ ' if it is a space character. By means of such a character sequence, Gcal notices that the text trailing the `\' character is no longer used for separating purposes, but is member of the text part. Gcal skips this specific, marking backslash character (avoids its output) and processes the rest of the line as usual.

The following example should be enough to elucidate the above facts. The resource file `whitespc.rc'

0 BANG BANG
0 bogus
0         bogomips
0    \hello world
0    \ main(){for(;;)fork();}
0 \     sh $0 & $0 &
0    \  a  \  b  \\  c  \\\  d
0    What happens now?\
~0  \  This!
0    What happens now?\\
~0  \  That!

is displayed as follows:

$ gcal --resource-file=whitespc.rc --disable-highlighting
-|
-| Fixed date list:
-| 
-| Wed, Sep  14th 1994:      sh $0 & $0 &
-| Wed, Sep  14th 1994:   a  \  b  \\  c  \\\  d
-| Wed, Sep  14th 1994:  main(){for(;;)fork();}
-| Wed, Sep  14th 1994: BANG BANG
-| Wed, Sep  14th 1994: What happens now?~0  \  That!
-| Wed, Sep  14th 1994: What happens now?
-|                      0  \  This!
-| Wed, Sep  14th 1994: \hello world
-| Wed, Sep  14th 1994: bogomips
-| Wed, Sep  14th 1994: bogus


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