## `output::tableForm` -- printing objects in table form

#### Introduction

`output::tableForm(`obj`)` prints the object `obj` in table form.

#### Call(s)

`output::tableForm(object <, seperator> <, options>)`

#### Parameters

`object` | - | list or set of any MuPAD objects
`seperator` | - | string between columns
`options` | - | one single option or a set of options

#### Options

`Unquoted` | - | strings will be printed without quotes
`Unique` | - | all columns are of the same width
`Left, Center, Right` | - | the entries will be aligned left, center or right
`Sort= procedure` | - | the entries will be sorted
`Output= file` | - | Output into a file.

#### Returns

no return value

#### Related Functions

`output::tree`, `print`, `fopen`, `fprint`, `fclose`

#### Details

- `output::tableForm` prints the elements of the given object in table form. The width of the table depends on the size of `TEXTWIDTH`. The width of a column depends on the widest entry in this column.
- If `seperator` is given then it is appended to each object. Appending spaces to the separator results additionally space between columns. By default the separator is one space.
- Without the option Sort the objects will be converted to strings an then sorted alphabetically.

#### Option: Unquoted

- The output function `fprint` will be calles with the option Unquoted. E. g. strings will be printed without quotes.

#### Option: Unique

- All columns will be printed with the same width, the widest column determines the width.

#### Option: Left, Center, Right

- The entries of each column will be aligned left, center or right.

#### Option: Sort = procedure

- The entries will be sorted with the given procedure. Without a procedure the entries will be printed unsorted.

#### Option: Output = file

- Output into a file. If `file` is a string, a file named `file` will be opened and overwritten and closed after writing. If `file` is a file descriptor the table will be appended to `file` without closing `file`.

#### Example 1

    >> output::tableForm(anames(DOM_DOMAIN))

          ClientObject DOM_ARRAY    DOM_BOOL   DOM_COMPLEX
          DOM_DOMAIN   DOM_EXEC     DOM_EXPR   DOM_FAIL
          DOM_FLOAT    DOM_FUNC_ENV DOM_IDENT  DOM_INT
          DOM_LIST     DOM_NIL      DOM_NULL   DOM_POINT
          DOM_POLY     DOM_POLYGON  DOM_PROC   DOM_PROC_ENV
          DOM_RAT      DOM_SET      DOM_STRING DOM_TABLE
          DOM_VAR      Plot         Pref       misc
          output       plot         polylib    specfunc
          stdlib

    >> output::tableForm(map(anames(DOM_DOMAIN), expr2text), "  ", {Unique, Center})

          "ClientObject"   "DOM_ARRAY"      "DOM_BOOL"
          "DOM_COMPLEX"    "DOM_DOMAIN"     "DOM_EXEC"
            "DOM_EXPR"      "DOM_FAIL"     "DOM_FLOAT"
          "DOM_FUNC_ENV"   "DOM_IDENT"      "DOM_INT"
            "DOM_LIST"      "DOM_NIL"       "DOM_NULL"
           "DOM_POINT"      "DOM_POLY"    "DOM_POLYGON"
            "DOM_PROC"    "DOM_PROC_ENV"    "DOM_RAT"
            "DOM_SET"      "DOM_STRING"    "DOM_TABLE"
            "DOM_VAR"         "Plot"          "Pref"
              "misc"         "output"         "plot"
            "polylib"       "specfunc"       "stdlib"

    >> output::tableForm(anames(DOM_DOMAIN), ", ", {Sort = FALSE, Right})

          ClientObject,    DOM_ARRAY,   DOM_BOOL,  DOM_COMPLEX,
            DOM_DOMAIN,     DOM_EXEC,   DOM_EXPR,     DOM_FAIL,
             DOM_FLOAT, DOM_FUNC_ENV,  DOM_IDENT,      DOM_INT,
              DOM_LIST,      DOM_NIL,   DOM_NULL,    DOM_POINT,
              DOM_POLY,  DOM_POLYGON,   DOM_PROC, DOM_PROC_ENV,
               DOM_RAT,      DOM_SET, DOM_STRING,    DOM_TABLE,
               DOM_VAR,         Plot,       Pref,         misc,
                output,         plot,    polylib,     specfunc,
                stdlib

#### Changes

- used to be called `misc::tableForm`
- output of elements of sets or lists, only one string as separator
- new options Unique, Left, Center, Right, Sort and Output
- enhanced alignment, column formatting, output to files

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000