# Flags)

> [HTML Version](flags_mx148.htm)

_Reviewed and revised November 2018_

The optional _flags_ parameter is used to calculate the optimum rectangle size for the specified memo after reformatting it according to various options.

In this case, the _rght_ and _btm_ parameters are also returned, indicating the adjusted rectangle dimensions required for printing the memo string. For single line memos (TRF\_SINGLELINE set, or TRF\_WORDBREAK not set and no CRLFs in the line), the width of the rectangle will be adjusted to fit the text. Otherwise, if TRF\_WORDBREAK is specified, it will preserve the width of the rectangle, breaking the lines as needed to fit within that width, and adjusting the height of the rectangle.

Formatting options for _flags_ are chosen from the TRF\_xxx flags used by TEXTRECTANGLE (reprinted below), with the mandatory inclusion of the TRF\_CALCRECT bit. 

| **Flag** | **Value** | **Meaning** |
|------|------|------|
| TRF\_TOP | \&h00000000 | top justification |
| TRF\_LEFT | \&h00000000 | left justification |
| TRF\_HCENTER | \&h00000001 | horizontal centering |
| TRF\_RIGHT | \&h00000002 | right justification |
| TRF\_VCENTER | \&h00000004 | vertical centering |
| TRF\_BOTTOM | \&h00000008 | bottom justification |
| TRF\_WORDBREAK | \&h00000010 | wrap the text onto multiple lines |
| TRF\_SINGLELINE | \&h00000020 | output text as a single line |
| TRF\_EXPANDTABS | \&h00000040 | expand tabs (8 spaces each) |
| TRF\_NOCLIP | \&h00000100 | no clipping |
| TRF\_EXTERNALLEADING | \&h00000200 | incl. ext. leading in spacing |
| TRF\_CALCRECT | \&h00000400 | calc only (use with MX\_GDICALC) |
| TRF\_PATH\_ELLIPSIS | \&h00004000 | path ellipsis |
| TRF\_END\_ELLIPSIS | \&h00008000 | end ellipsis |
| TRF\_WORD\_ELLIPSIS | \&h00040000 | word ellipsis |
| **Definition file: [ashell.def](ashell_def.md)** | | 

