||Stores the text that is formed|
||Case to use for letters (
||Whether to append or concatenate the values of the structures (
||Characters to separate all except last two strings in each line when concatenating; default
||Characters to separate last two strings in each line when concatenating; default uses the characters defined by
||Characters to put at the start of each line when concatenating; default
||Characters to put at the end of each line when concatenating; default
||Specifies the number of significant figures to include for numerical data; default 4|
||Structures whose values are to be appended or concatenated|
||Number of characters to take from the strings formed from the units of each
||Number of decimal places to use for numerical structures; if omitted or set to a missing value, a default is used which aims to print the value to the precision defined by the
||Number of characters to skip at the left-hand side of the strings formed from the units of each
||How to represent factor values (
||Format to use for dates and times (stored in numerical structures)|
||Whether to reverse the strings of characters formed from the units of each structure (yes, no); default no|
||String to use to represent missing values of numerical structures; default
TXCONSTRUCT directive forms a text from the values of scalars, variates, texts, factors or pointers. The new text is saved using the
TEXT option, and the structures from which it is to be formed are listed using the
By default the values of the structures are concatenated alongside each other (as with the
CONCATENATE directive); alternatively you can set option
to append them below each other. When you are concatenating, the structures in the
STRUCTURE list must generally contain the same number of values (and this then defines the number of lines in the new text). The exception is that the
STRUCTURE list can include scalars or texts containing a single string if you want to put the same numbers or strings into every line of the new text.
Numerical values (from scalars, variates or factors) are converted into strings of characters before they are used. As in the
DREPRESENTATION parameter to indicate whether these are to be treated as dates. Alternatively, if they are to remain as numbers, the
DECIMALS parameter specifies the number of decimal places to use.
DECIMALS can be set to a scalar if all the values of the structure are to be printed with the same number of decimals, or to a variate if you want to represent different units of a variate or factor structure with different numbers of decimals. The
SIGNIFICANTFIGURES option specifies the number of significant figures to aim for if
DECIMALS is not set, or if it contains missing values (default 4). A numerical value will then be converted as though it had been printed with the number of decimals required to give
SIGNIFICANTFIGURES significant figures, and any trailing zero decimal values had then been removed. Missing numerical values are represented by the asterisk character (
*) by default, in the usual way, but you can specify another string of characters using the
A formula is converted to a text before being concatenated. The maximum width is defined as 200. So this will be a text with one line, unless the result is more than 200 characters wide.
SKIP parameter allows you to skip characters at the start of the strings provided by each structure. You can supply a scalar to skip the same number of characters in every string, or a variate if you want to make different skips in every string. Similarly the
WIDTH parameter specifies how many characters are to be taken, after omitting any initial characters as specified by
SKIP. The strings formed from scalars, variates, factors and pointers do not contain any initial or trailing spaces. You can set a negative skip to ignore all the initial spaces in a string taken from a text structure, and set a negative width to ignore all its trailing spaces. The
REVERSE parameter allows you to reverse the strings from any of the structures.
CASE option enables you to change the case of letters in the strings. The available settings are:
||to leave the case of each letter exactly as given in the string;|
||to change all letters to upper case (or capitals);|
||to change all letters to lower case;|
||to put lower-case letters into upper case, and upper-case letters into lower case;|
||to put the first character in the text (if a letter) into upper case, then to use upper case only at the start of each new sentence;|
||to begin each new word with a capital letter, but otherwise to use lower case.|
METHOD=concatenate you can use the
END options to insert characters automatically between the adjacent pairs of strings in each line.
LASTSEPARATOR supplies a string of characters to insert between the last pair of strings,
SEPARATOR supplies characters to insert between all the other pairs of strings,
PREFIX supplies characters to put at the start of each line, and
END supplies characters to put at the end of each line. The defaults for
END are the empty string
LASTSEPARATOR uses the characters defined by
SEPARATOR as its default. So by default no characters are inserted.
TXCONSTRUCT takes account of restrictions on any of the vectors that occur in the statement. If more than one vector is restricted, then each such restriction must be the same. The values of the units in the new text that are excluded by the restriction are left unchanged.
Commands for: Calculations and manipulation.
" Examples 1:4.7.1a, 1:4.7.2.a and 1:4.7.7 " TEXT [VALUES='1. Adams','2. Baker','3. Clarke','4. Day',\ '5. Edwards','6. Field','7. Good','8. Hall',\ '9. Irving','10. Jones'] Name TEXT [VALUES='B.J.','J.S.','K.R.','A.T.','R.S.',\ 'T.W.','S.I.','D.M.','H.M.','C.C.'] Initials " Form text Fullname containing the number, name and initials." CONCATENATE [NEWTEXT=Fullname] OLDTEXT=Name,', ',Initials PRINT Fullname; JUSTIFICATION=left " Now reform Fullname to contain just the first initial and the name." CONCATENATE [NEWTEXT=Fullname] OLDTEXT=Initials,Name;\ WIDTH=2,*; SKIP=*,!(9(2),3) PRINT Fullname; JUSTIFICATION=left VARIATE [VALUES=35,42,19,26,33,52,23,28,44,17] Age TXCONSTRUCT [TEXT=Fullname; SEPARATOR=''; LASTSEPARATOR=', age ';\ END='.'] Initials,Name,Age; WIDTH=2,*,*; SKIP=*,!(9(2),3),* PRINT Fullname; JUSTIFICATION=left