November 23, 2023

PE (PhraseEnding) - XpressDox

Use PhraseEnding to punctuate the ends of phrases or clauses.

 

The PhraseEnding (shortened to PE) command is used to control punctuation at the end of conditional phrases or clauses. Say for instance you have checkboxes which include or exclude certain clauses, and those clauses should be punctuated with semi-colons. The second to last one should be a semi-colon + the word ‘and’, and the very last clause should have a full stop/period. Without the use of the PE command, this is very difficult to achieve when there are multiple conditional clauses.

 

In order to achieve the correct punctuation, you need a PE command to define what kind of punctuation you want. And you also need a PE command in the places where the punctuation is needed, as can be seen in the example below. Copy and paste the contents of the code snippet into a Word document.


«Comment(define checkboxes. Use a Question command, a Define command or a ChooseUsingCheckbox command.)»
«Define(CheckAll,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«Define(Clause1,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«Define(Clause2,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«Define(Clause3,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«Define(Clause4,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«Define(Clause5,,,,,ChooseUsingCheckBox,Y;N;N,,,;;,;;,;)»
«DefineSetAllGroup(CheckAll,Clause1,Clause2,Clause3,Clause4,Clause5)»

«PE('; ','; ','.')»
«if(IsTrue(Clause1))»

Clause 1 Lorem ipsum dolor sit amet, consectetuer adipiscing elit«PE()»
«End()»
«if(IsTrue(Clause2))»

Clause 2 Nunc viverra imperdiet enim«PE()»
«End()»
«if(IsTrue(Clause3))»

Clause 3 Pellentesque habitant morbi tristique senectus egestas«PE()»
«End()»
«if(IsTrue(Clause4))»

Clause 4 Aenean nec lorem laoreet nonummy augue«PE()»
«End()»
«if(IsTrue(Clause5))»

Clause 5 Suspendisse dui purus, scelerisque at«PE()»
«End()»

 

 

The parameters in the «PE()» command:

 

The name of the collection of endings: An optional parameter. Although there is also a List command which is useful to create a list from repeated items, this command can be used in a ForEach. Should that be your intention, a name of the collection is required.
Do you want to define the collection of endings? If yes, then a command such as this one «PE('; ','; ','.')» can be inserted i.e. the definition of the punctuation.
If no, then a simple «PE()» command can be inserted i.e. the insertion point of the punctuation into the document.
Do you want the long or short version of the function name? Short = Inserts «PE()»
Long = Inserts «PhraseEnding()»
The intermediate text The punctuation between clauses e.g. a comma or a semi-colon
Second last text Punctuation after the second to last clause e.g. a comma + ‘and’, or a semi-colon + ‘and’
Last text The punctuation at the end of the last clause. Usually a full stop/period.

 

 

Using the «PE()» command in multi-level ForEach repeaters:

You can also use the PE command in multi-level repeaters, as shown below:

«Name»
«ForEach(Company)»
Company Name: «CompanyName»«PE(‘Comp’,’;’,’ and lastly’,’.’)»
Lorem ipsum dolor sit amet, consectetuer adipiscing elit sit amet commodo magna eros quis urna«PE(‘Comp’)»
Nunc viverra imperdiet enim. Fusce est«PE(‘Comp’)»
Pellentesque habitant morbi tristique senectus et netus«PE(‘Comp’)»
Aenean nec lorem«PE(‘Comp’)»
Suspendisse dui purus«PE(‘Comp’)»
«ForEach(Director)»
Director Name: «DirectorName»«PE(‘dir’,’-’,’ and finally’,’--’)»
Lorem ipsum dolor sit amet, consectetuer adipiscing elit«PE(‘dir’)»
Nunc viverra«PE(‘dir’)»
Pellentesque habitant morbi«PE(‘dir’)»
«End(Dir)»
And another one at the end of company«PE(‘Comp’)»
«End(Comp)»