Z-MOD11

This document covers the following topics:


Description

Modify the text of an existing document using data from a text array (A251/1:20).

The new text can either be in the Txt or Cnf format. The original text is deleted and substituted with the new text. The document information such as the description or keywords are retained.

You cannot modify the text of a document which is stored in a system folder (except Work).

The parameter Text-array must be redefined as:

Byte Number Description
1 Number of line feeds (1 to 9)
2 to 251 Text

Blank text lines (i.e. line feeds) must be defined separately; for example, when you specify the value 9, this must not be followed by any text. Text lines must always be preceded by the value 1 (when you do not enter a value, 1 is automatically used). For example:

MOVE '1This line contains text'    TO TEXT-ARRAY (1)
MOVE '2'                           TO TEXT-ARRAY (2)   /* inserts 2 blank lines
MOVE '1This is another text line'  TO TEXT-ARRAY (3)

Blank lines after the document text can be suppressed by specifying the number of text lines that are to be stored in the Number parameter. If the Number parameter is not specified, 20 is assumed.

This subprogram can be called iteratively to create a text of any length. During successive calls you must take care that the Work-parameter is not disturbed by the calling routine.

The parameter Text-array is not reset after a call. Thus, when using this subprogram iteratively, you must reset the Text-array parameter before filling it again.

With the last text record, you must set the parameter End-flag to terminate the modifying process and to unlock the document.

When you modify the text of a TRS document and if Con-nect Text Retrieval cannot be invoked (return code 06), the TRS error number is returned in the parameter TRS-return-code.

A modified TRS document is inverted online unless it is longer than the length permitted by the administrator. If it is, the document is automatically filed in folder TRS-XXL and inverted when the utility B10000 is run (see the Con-nect Utilities documentation, section Invert Long Documents for further information).

Parameters

Parameter Format In Out Remarks
Return-code N2 O X Input -1: no ET.
TRS-return-code P4   X When this subprogram has been terminated successfully, the value 0 is returned. Any other value indicates an internal error.
Cabinet A8 R   The cabinet in which the document is to be modified.
Password A8 R   The password of the above cabinet.
Document-name A32 R*   The name of the document to be modified. Either Document-name or ISN, not both.
ISN P10 R*   The ISN of the document to be modified. Either ISN or Document-name, not both. You can invoke Z-DIS11 prior to this subprogram to obtain the ISN for the desired document.
Document-format A1 R   0=Txt or 1=Cnf.
Text-array A251/1:20 R   The new text for the document.
Number N2 O   The number of lines that are to be stored with each call. When you do not specify a value, or when you specify a value greater than 20, the default value 20 is used.
End-flag A1 R   Terminates the modifying process and unlocks the document. When you call this subprogram iteratively, the End-flag is only required with the last text record (as specified in the Number parameter).
Work-parameter A25     For internal use. See The Work Parameter.

Return Codes

00 Success
02 Invalid cabinet name
03 Password incorrect
04 ISN was not found
06 TRS could not be invoked
08 Supply either ISN or name, not both
09 ISN does not point to correct object
10 Function not valid for a system folder
16 Document is locked - editing was not completed
51 Invalid name
53 Requested object does not exist
79 Invalid document format
92 Inconsistency between Work-parameter and original document, or between Work-parameter and backup version, or between original document and backup version

Subprograms

Z-120
Z-122
Z-123
Z-135
Z-147
Z-161
Z-161A
Z-161B
Z-180
Z-190
Z-1200&0