1. Home
  2. TEXT directive

TEXT directive

Declares one or more text data structures.

Options

NVALUES = scalar or vector Number of strings, or vector of labels; default * takes the setting from the preceding UNITS statement, if any
VALUES = strings Values for all the texts; default *
MODIFY = string token Whether to modify (instead of redefining) existing structures (yes, no); default no
IPRINT = string tokens Information to be used by default to identify the texts in output (identifier, extra); if this is not set, they will be identified in the standard way for each type of output

Parameters

IDENTIFIER = identifiers Identifiers of the texts
VALUES = texts Values for each text
CHARACTERS = scalars Numbers of characters of the lines of each text to be printed by default
EXTRA = texts Extra text associated with each identifier

Description

Each unit of a Genstat text structure is a string which you can regard as a line of textual description. Texts can be used to label vectors and pointers, for captions or pieces of explanation within output, to store Genstat statements and to store output.

The IDENTIFIER parameter lists the texts that are to be declared. Values can be assigned to the texts by either the VALUES option or the VALUES parameter. The option defines a common value for all the texts in the declaration, while the parameter allows them each to be given a different value. If both the option and the parameter are specified, the parameter takes precedence.

The NVALUES option allows the number of values in the texts to be defined. If this is not set, the lengths of the texts are defined from the numbers that are supplied by the VALUES option or parameter. If these too are unset, Genstat takes the length specified by the preceding UNITS statement, if any.

The CHARACTERS parameter allows you to define the number of characters to be printed by default when the strings of each text are printed. You can associate a text of extra annotation with each table using the EXTRA parameter.

If the MODIFY option is set to yes any existing attributes and values of the texts are retained (if still appropriate); otherwise these are lost. The IPRINT option can be set to specify how the texts will be identified in output. If IPRINT is not set, they will be identified in whatever way is usual for the section of output concerned. For example, the PRINT directive generally uses their identifiers (although this can be changed using the IPRINT option of PRINT itself).

Options: NVALUES, VALUES, MODIFY, IPRINT.
Parameters: IDENTIFIER, VALUES, CHARACTERS, EXTRA.

See also

Directives: CONCATENATE, EDIT, TXBREAK, TXCONSTRUCT, TXFIND, TXINTEGERCODESTXPOSITION, TXREPLACETX2VARIATEFACTOR, VARIATE, UNITS.
Procedures: TXPAD, TXPROGRESSION, TXSPLIT.
Functions: CHARACTERS, GETFIRST, GETLAST, GETPOSITION, POSITION.

Commands for: Data structures.

Example

" Examples 1:4.4.3a-c "
VARIATE [VALUES=18,50,24,49,61,29,32,42,36,40] Age
& [VALUES=3000,17500,5000,20000,7000,4500,\ 
   12000,18000,15500,17500] Income
TEXT [VALUES=Clarke,Innes,Adams,Jones,Day,\ 
   Grey,Edwards,Baker,Hill,Foster]   Name
FACTOR [LABELS=!T(male,female); VALUES=2,1,1,1,2,2,1,1,2,1] Sex
PRINT Age,Income,Name,Sex; FIELD=12
SORT [INDEX=Name] Age,Income,Name,Sex
PRINT Age,Income,Name,Sex; FIELD=12
SORT [DIRECTION=descending] Age,Income,Name,Sex
PRINT Age,Income,Name,Sex; FIELD=12
SORT [INDEX=Income,Name] Age,Income,Name,Sex
PRINT Age,Income,Name,Sex; FIELD=12
Updated on September 3, 2019

Was this article helpful?