...
Code Block |
---|
{id}'s full name: <{ln}, {fn}??withheld>
|
This example includes the following rules:
...
Code Block |
---|
{A}
{A.B[2] + C('text')}
{A.B(C)}
|
The angle bracket indicates a format group, where constant text is only included if one or both adjoining references are non-empty. The expression to the right of the ??
(coalesce) operator is used if the format group evaluates to empty. The ??
section is optional.
...
The following examples will try to illustrate the various paths that an evaluation of a formatting group can take.
Code Block |
---|
<{A}, {B}>
|
A | B | Result |
---|---|---|
| ||
1 | 2 | 1, 2 |
1 | 1 | |
2 | 2 |
Code Block |
---|
<{A};{B};{C}: Message>
|
A | B | C | Result |
---|---|---|---|
| |||
1 | 2 | 3 | 1;2;3: Message |
1 | 2 | 1;2 | |
1 | 1 | ||
2 | 3 | 2;3: Message |
Code Block |
---|
<{A} items??empty>
|
A | Result |
---|---|
1 | 1 items |
empty |
Code Block |
---|
<{A}, {B}.??<{C}??Nothing defined!>>
|
A | B | C | Result |
---|---|---|---|
1 | 2 | 3 | 1, 2 |
2 | 3 | 2 | |
1 | 3 | 1 | |
3 | 3 | ||
Nothing defined! |
...
Code Block |
---|
My name is <{LastName}, {FirstName} {MiddleInitial}.> and my phone number is <{MobNumber}??<{TelNumber}??<{FaxNumber}>>>.
|
LastName | FirstName | MiddleInitial | MobNumber | TelNumber | FaxNumber | Result |
---|---|---|---|---|---|---|
Doe | John | Q | 0765551111 | 0765552222 | 0765553333 | My name is Doe |
Doe | John | Q | 0765552222 | 0765553333 | My name is Doe | |
Doe | John | 0765552222 | 0765553333 | My name is Doe | ||
Doe | 0765553333 | My name is Doe and my phone number is 0765553333. | ||||
Doe | My name is Doe and my phone number is . | |||||
John | My name is John and my phone number is . | |||||
0765553333 | My name is and my phone number is 0765553333. | |||||
My name is and my phone number is . |
...
Code Block |
---|
<My name is <{LastName}, {FirstName}, {MiddleInitial}.> and my phone number is <{MobNumber}??<{TelNumber}??<{FaxNumber}>>>.??No data>
|
LastName | FirstName | MiddleInitial | MobNumber | TelNumber | FaxNumber | Result |
---|---|---|---|---|---|---|
Doe | John | Q | 0765551111 | 0765552222 | 0765553333 | My name is Doe |
Doe | John | Q | 0765552222 | 0765553333 | My name is Doe | |
Doe | John | 0765552222 | 0765553333 | My name is Doe | ||
Doe | 0765553333 | My name is Doe and my phone number is 0765553333. | ||||
Doe | My name is Doe | |||||
John | My name is John | |||||
0765553333 | 0765553333. | |||||
No data |
...