This document covers the following topics:
Add a Con-nect document using data from a text array (A251/1:20).
This subprogram supports all Con-nect document formats. The document is always filed in folder Work and is sorted according to the Author-date.
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, it must not be followed by 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 add a document 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 parameter Text-array before filling it again.
When you want to upload old documents (for example, from 1988) into Con-nect, it is recommended that you specify the original date in the parameter Author-date. The original date will then be interpreted as the date the document was created. The current date (i.e. the date the document was added to Con-nect) will then be interpreted as the date the document was last modified.
Author-date and Author-time must be either equal to or occur prior to the current date and time. If these parameters are not specified, the current date and time are automatically used.
The expiration date is the current date plus the defined number of days until expiration.
Parameter | Format | In | Out | Remarks |
---|---|---|---|---|
Return-code | N2 | O | X | Input -1: no ET. |
Cabinet | A8 | R | The cabinet in which the document is to be added. | |
Password | A8 | R | The password of the above cabinet. | |
Document-name | A32 | R | The name of the document to be added. It need not be specified, if the first line of the Description is specified. | |
Description | A60/1:4 | O | A brief description of the document. If you do not specify a Document-name, you must specify a Description. | |
Keywords | A15/1:6 | O | Keywords are helpful when you search for an object. You can specify up to 6 keywords. A keyword must not contain an asterisk (*). | |
Document-format | A1 | R | 0 - 9. See Document Formats. | |
Text-array | A251/1:20 | R | The text for the document. | |
Number | N2 | O | The number of lines that are 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. | |
Upload-format | A1 | O | If marked, a conversion from the old Entire Connection transmission format (A120) back to the original binary format (B90) occurs. This applies to Bin, RFT, FFT and Vce documents. | |
Author-ID | A8 | O | The ID of the author. If you do not specify an author, the ID of the current user is automatically used. | |
Author-date | N8 | O | The date when the document was created. Format yyyymmdd. | |
Author-time | N4 | O | The time (GMT) when the document was created. Format hhmm. | |
ISN | P10 | X | The ISN of the new document. | |
Work-parameter | A40 | For internal use. See The Work Parameter. |
00 | Success |
02 | Invalid cabinet name |
03 | Password incorrect |
41 | Invalid Author-date |
42 | Invalid Author-time |
51 | Invalid name |
52 | Document with specified name already exists |
54 | At least one keyword was invalid |
58 | No directory record has been created |
79 | Invalid document format |
91 | Invalid Author-ID |
Z-120
Z-122
Z-123
Z-135
Z-160
Z-162
Z-175
Z-190
Z-1200&0
0010 * 0020 * Example program to add a document from a text array 0030 * 0040 DEFINE DATA 0050 LOCAL 0060 1 RETURN-CODE (N2) 0070 1 CABINET (A8) 0080 1 PASSWORD (A8) 0090 1 DOCUMENT-NAME (A32) 0100 1 DESCRIPTION (A60/1:4) 0110 1 KEYWORDS (A15/1:6) 0120 1 DOCUMENT-FORMAT (A1) 0130 1 TEXT-ARRAY (A251/1:20) 0140 1 NUMBER (N2) 0150 1 UPLOAD-FORMAT (A1) 0160 1 AUTHOR-ID (A8) 0170 1 AUTHOR-DATE (N8) 0180 1 AUTHOR-TIME (N4) 0190 1 ISN (P10) 0200 1 WORK-PARAMETER (A40) 0210 * 0220 END-DEFINE 0230 * 0240 RESET WORK-PARAMETER 0250 MOVE 'CABINET ' TO CABINET 0260 MOVE 'PASSWORD' TO PASSWORD 0270 MOVE 'Document created by ADD11D ' TO DOCUMENT-NAME 0280 MOVE 'Document description line 1' TO DESCRIPTION(1) 0290 MOVE 'Document description line 3' TO DESCRIPTION(3) 0300 MOVE 'Keyword1' TO KEYWORDS(1) 0310 MOVE '0' TO DOCUMENT-FORMAT 0320 MOVE '1Line 1 of text of document' TO TEXT-ARRAY(1) 0330 MOVE '1Line 2 of text of document' TO TEXT-ARRAY(2) 0340 MOVE 2 TO NUMBER 0350 MOVE 'ESH' TO AUTHOR-ID 0360 MOVE 19960831 TO AUTHOR-DATE 0370 MOVE 1900 TO AUTHOR-TIME 0380 * 0390 CALLNAT 'Z-ADD11D' 0400 RETURN-CODE 0410 CABINET 0420 PASSWORD 0430 DOCUMENT-NAME 0440 DESCRIPTION(*) 0450 KEYWORDS(*) 0460 DOCUMENT-FORMAT 0470 TEXT-ARRAY(*) 0480 NUMBER 0490 UPLOAD-FORMAT 0500 AUTHOR-ID 0510 AUTHOR-DATE 0520 AUTHOR-TIME 0530 ISN 0540 WORK-PARAMETER 0550 * 0560 IF RETURN-CODE EQ 0 0570 WRITE 'Document ' DOCUMENT-NAME 'was added' / 0580 'ISN of document record' ISN 0590 ELSE 0600 WRITE 'Return code' RETURN-CODE 0610 END-IF 0620 END