Next: , Previous: Further date part attributes, Up: Resource file

#### 5.1.4 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 them1 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 set2 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 characters3 may also occur in the text part, but they only cause the suppression of all succeeding characters in 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 lead to the same problems as 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 another ‘\’ (backslash) character, 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 lbrk-1.rc

 \$ cat lbrk-1.rc -| ; Hi, I'm `lbrk-1.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 %00000101 --resource-file=./lbrk-1.rc --disable-highlighting -| -| Fixed date list: -| -| Sat, Jan 1st 2000: Am I another short text? Dunno... -| Sat, Jan 1st 2000: I hope I'm also long enough -| here, a line break-up -| and again -| and now for the last time... -| Sat, Jan 1st 2000: I hope I'm long enough -| here, a line break-up -| and again -| and now for the last time... -| Sat, Jan 1st 2000: I know I'm a short text

Because whitespace characters are used to separate the date part from the text part4, it is 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 wspc-1.rc

 \$ cat wspc-1.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=./wspc-1.rc --disable-highlighting -| -| Fixed date list: -| -| Wed, Jun 14th 2000: sh \$0 & \$0 & -| Wed, Jun 14th 2000: a \ b \\ c \\\ d -| Wed, Jun 14th 2000: main(){for(;;)fork();} -| Wed, Jun 14th 2000: BANG BANG -| Wed, Jun 14th 2000: What happens now?~0 \ That! -| Wed, Jun 14th 2000: What happens now? -| 0 \ This! -| Wed, Jun 14th 2000: \hello world -| Wed, Jun 14th 2000: bogomips -| Wed, Jun 14th 2000: bogus

#### Footnotes

[1] Like ‘%i’, ‘\$a...

[2] These are potentially non-printable.

[3] That is the character with the value zero in the code table of the used character set.

[4] These are internally skipped and remain undisplayed therefore.