1. The user selects file to import (See "Adding a table" on page 2-2).
2. The file extension (suffix) is used to locate the appropriate processing rules in the initialization file.
3. The API extracts the format name from the initialization file by checking the ``Format'' and ``FormatNumcolumns'' parameters. If initialization file designates ``FormatNumcolumns=yes'', then the API looks at the first row of ASCII text and counts the number of columns. The number of columns is subtracted by one and appended to the format name as designated by the Format parameter. For example, if you have 5 columns of ASCII text, and the corresponding information in the initialization file says:
Format=Apple
FormatNumcolumns=yes
4. The Table API searches the reference pages of the current document for a table with a format name that matches the one it found in the previous step. If it does not find a match, it searches the table catalog. The matching format must be found in the reference pages or the table catalog or an error message will appear and the API will be unable to insert a table.
5. Once API has initially created the table, it reads a line of ASCII text.
6. Using the format rules found in the initialization file and markup symbols in the ASCII text, the API formats the line of ASCII text and converts it into a table row. See "Text formatting" on page 3-8 for information on text formatting using markup symbols.
7. Steps 5 and 6 are repeated for each successive line of the text file.
1. On the body page of your template, use the FrameMaker Table menu to create one sample table of each type you plan to use in your documents. Refer to your FrameMaker manual if you are unfamiliar with creating tables. Type in some actual or sample data so you can see how the table will look when it is completed. You also may want to specify particular paragraph formats for different areas of your table.
2. When you have finished designing your table, choose New Format from the Commands pop-up menu in the Table Designer window. Type in the format name.
3. Turn on Store in Catalog and Apply to Selection and click on Create.
4. Decide whether you are going to store the format in the table catalog or the reference pages.
5. Table catalog
6. Highlight the entire table and copy it to the reference pages of your template.
A sample initialization file has been included with this release. This may be used as a reference or it may be modified to create a new initialization file. See also Appendix B, ``Sample Initialization file'' on page B-1.
Initialization file syntax
The initialization file contains a series of table definition sections for each table format used. Each section should contain all the parameters listed below. Each parameter should be on a separate line. Do not insert blank spaces before or after the ``='' character.
TableDef=xxx
This parameter marks the beginning of a new table definition section. It corresponds to the file extension or suffix of the filename of the Cadence table or ASCII text file. This parameter is used by the API to match the table data to a table format name.
species.newt and trial.newt. The definition section
for those tables must begin with
TableDef=newt
Format=xxxxxxx
This parameter indicates which table format the API should use. It should correspond to a format name in the FrameMaker document.
species.newt and trial.newt to use a table format that is listed in the
tables catalog of your document as ``Apple''. The next line of your initialization file:
Format=Apple
Frame table format names are case sensitive, i.e., if the Frame table name is all lower-case letters, the Format parameter must also be in lower cases. You must also take blank spaces into account when typing in the format name. Leading or trailing blanks in the Frame table format name are not allowed.
Delimiter=x|yy
This parameter determines which character is used to indicate cell separations in the ASCII text or data file that is to be imported.
If only a single character is used, then x corresponds to the ASCII character used in the output table as the delimiter. If two characters are used, then yy corresponds to the hexadecimal representation of the character used as the delimiter.
Delimiter=|
Delimiter=7c
``='' cannot be used as a delimiter character.
Be careful not to pick a delimiter that occurs in the text files to be imported. We suggest using the ``Tab'' character, as most software programs are capable of producing tab-delimited files.
FormatNumColumns=yes|no
This parameter determines whether the format name should depend on the number of columns in the data. Valid values are ``yes''and ``no''. You can use either upper-case letters or lower-case.
The API counts the number of columns in the first row of text. The number of columns in the table data is subtracted by one and appended to the end of the FrameMaker table format name previously specified.
TableDef=newt
Format=Apple
Delimiter=.
FormatNumcolumns=Yes
species.newt, the complete format name that the
API will look for in the Frame document will be Apple5.
TableDef=newt
Format=Apple
Delimiter=.
FormatNumcolumns=no
StradleColumns=(n,n,...,n)
This parameter determines which table cells are straddled.
The n's represent the columns that should be straddled when creating the Frame table. Cells that are vertically adjacent in the specified columns are joined into one cell if their contents are exactly the same. Columns are counted upwards from 0, where 0 corresponds to the leftmost column.
If no columns are straddled, you should enter:
StradleColumns=()
species.newt:
TableDef=newt
Format=Apple
Delimiter=|
FormatNumcolumns=no
StradleColumns=(0,2,3)
The resulting table would look like this:
|
|
|
|
|
|
|---|---|---|---|---|
|
Newt
|
Alpha
  |
Blue
|
fast
|
yes
  |
|
Beta
  |
yes
  | |||
|
Sigma
  |
Green
|
yes
  | ||
|
Epsilon
  |
yes
  | |||
|
Omega
  |
Black
|
slow
|
yes
  | |
|
Delta
  |
yes
  | |||
|
Gamma
  |
Red
|
yes
  | ||
|
Omicron
  |
yes
  |
TableDef=newt
Format=Apple
Delimiter=|
FormatNumcolumns=no
StradleColumns=()
and the resulting table, using the same format and text file as above, would look like this:
|
|
|
|
|
|
|---|---|---|---|---|
|
Newt
  |
Alpha
  |
Blue
  |
fast
  |
yes
  |
|
Newt
  |
Beta
  |
Blue
  |
fast
  |
yes
  |
|
Newt
  |
Sigma
  |
Green
  |
fast
  |
yes
  |
|
Newt
  |
Epsilon
  |
Green
  |
fast
  |
yes
  |
|
Newt
  |
Omega
  |
Black
  |
slow
  |
yes
  |
|
Newt
  |
Delta
  |
Black
  |
slow
  |
yes
  |
|
Newt
  |
Gamma
  |
Red
  |
slow
  |
yes
  |
|
Newt
  |
Omicron
  |
Red
  |
slow
  |
yes
  |
species.newt
then the API would look for:
TableDef=newt
in the initialization file.
Row boundaries
The Table API treats each line of text as a table row. Thus, each row should be on a single line by itself.
The maximum number of columns in a table is 20, and the maximum length of a cell is 200 characters, including markup symbols. Maximum length of a line is 4,096 characters, including markup symbols.
Cell boundaries
Cell boundaries are denoted in the text file by a delimiter character which is specified in the initialization file. See "Preparing the initialization file" on page 3-4 and Appendix , ``Delimiter=x|yy'' on page 3-5.
The number of columns in the first row is used to determine the table format in cases where the format name depends on the number of columns.
Text formatting
With the exception of <$HR> and <$HS>, these are all properties which are bound to specific ranges of text. Thus, whenever there is a <$UN>, there must be a <$NX> at the end of the text to be underlined. All regular spaces bounded by <$O> and <$F> are replaced by hard spaces, whereas <$HR> and <$HS> are replaced by a single hard return or single hard space.
<$O>No newts were harmed during the production of this movie.<F>
No<$HS>newts<$HS>were<$HS>harmed<$HS>during<$HS>the<$HS>filming<$HS>of<$HS>this<$HS>movie.
<$UN>Homo sapiens<$NX> is a <$BO>rare<$NB> <$IT>species<$NI>!
<$UN>The <$BO>Descent<NB> of Man<$NX>
| cold   | fusion   |
<$UN>cold|fusion<$NX>
<$UN>cold<$NX>|<$UN>fusion<$NX>