Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Navigation: Subroutines > XTREE > XTREE Parameters > Coldef

Simple Multi-Column Coldef Syntax

Scroll Prev Top Next More

The simple multi-column syntax allows simple multi-column lists to be easily defined for GUI mode, in a way that is backwards compatible with text mode. It consists of a simple string containing the column titles spaced to match the actual column spacing in array.

If the XTF_FCOLDEF bit is set in the flags parameter, then the coldef parameter is ignored and the first line of the input data is used in its place. (This is particularly convenient for simple multi-column file based data, since it allows you to keep the column titles with the data itself.)

In order to recognize that a word is the beginning of a new column and not a continuation of the previous column, it must be preceded by two or more spaces. For example:

MAP1 COLDEF,S,100,"Zip   City           State"

!                  12345678901234567890123456"

 

The above code would define a three-column list. In order for this to work, the layout of the input data (either in array or the file) must match this layout. Note that one limitation of this method of defining the columns is that the actual column width in characters must be at least two columns wider than the column title. For example, if a column is to contain just a Y or N, but you want to display the title "Back Ordered?", then you would have to pad the column with about fifteen spaces to allow the column data to match up with the title string (unless this was the last column.) The Advanced Coldef syntax allow you to transcend this limitation.

The columnar interpretation of coldef presents a possible compatibility issue for existing applications counting on XTREE being upward compatible with PCKLST, namely that any prompt string containing alphanumeric (non-space) characters separated by two or more spaces would be interpreted as a multi-column definition in the new version. The chance of this happening, though, seemed remote enough (and in the case of text mode, harmless enough), that we decided it was reasonable to simply require you to remove the ambiguity in any existing prompt strings by eliminating the contiguous blanks if you are interested in using the GUI mode.