The HotDocs Computation Archive
Get Extra Help

0059 - Tabs in Text Strings

Description:

How to place a tab in a text string.


• Explanation •

"\t" within your computation will create a tab character. For example:

"Col 1\tCol 2\tCol 3"

will produce:

Col 1     Col 2     Col 3

This works very well for creating simple, makeshift tables of variables. For example, the text string "«Var1»\t«Var2»\t«Var3»" will produce:

«Var1»     «Var2»     «Var3»

For an example of how this technique can be used with a REPEAT, see Computation #0018: Column-Style Repeat in a Computation.

See also Computation #0012: Returns in Text Strings.


•  •  •  •  •  •  •

A Note On Escape Characters
(from the HotDocs ListServ)

The "tricks and techniques" to which [List Member] refers (and which are undocumented in the HotDocs manuals) are called "escape sequences". They are primarily used to put non-printable characters that execute actions in an output stream, and date back to the very earliest days of computers, key punch machines and line code (carriage return has a specific meaning here!). I have tested all the escape sequences (there are 10 of them) available and found that only two (\r for carriage return, and \t for horizontal tab) work in HotDocs. This would suggest that they were specifically programmed into the HotDocs code at some time in the past by some programmer for an unknown reason. They are undocumented because they were unknown until someone tried one and after finding it successful, posted it to the HotDocs list. They will remain undocumented, and therefore, unsupported if something changes in HotDocs to inadvertently mess them up.

So, there you have it. Two escape sequences that may be used in computations and Multiple Choice merge text to insert either a soft return (\r) or a horizontal tab (\t) in the outputted text.