This procedure takes the input text and rearranges it according to the escapement rules of the ccsversion. Both the character advance direction and the character escapement direction are used. If the character advance direction is positive, then the starting position for the text is the leftmost position in the DEST parameter. If the character advance direction is negative, then the starting position for the text is the rightmost position in the DEST parameter. From that point on, the character advance direction value and the character escapement direction values, in combination, control where each character should be placed in relation to the previous character.
Example
This example takes the string ABCDEFG and rearranges it according to the escapement rules of the ccsversion. Assume for this example a ccsversion number of 999 with a character advance direction (CAD) of plus (+, left to right) and with the following character escapements:
|
Character |
Escapement |
Meaning |
|
A |
+ |
Left to right |
|
B |
- |
Right to left |
|
C |
- |
Right to left |
|
D |
- |
Right to left |
|
E |
+ |
Left to right |
|
F |
+ |
Left to right |
|
G |
blank |
Use CAD value |
BEGIN
$ INCLUDE INTL="SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 49999999
DEFINE SOURCE_START = 0 #
,DEST_START = 0 #;
FILE OUT(KIND=DISK,UNITS=CHARACTERS,FILEUSE=IO,FILETYPE=0,NEWFILE,
MAXRECSIZE=80,TITLE="OUT/ALGOL/VSNESCAPEMENT.");
EBCDIC ARRAY SOURCE[0:6]
,DEST[0:6];
INTEGER VSN_NUM
,TRANS_LEN
,RESULT;
VSN_NUM := 999;
REPLACE SOURCE[0] BY "ABCDEFG" FOR 7;
TRANS_LEN := 7;
RESULT := VSNESCAPEMENT(VSN_NUM, SOURCE, SOURCE_START, DEST,
TRANS_LEN);
WRITE(OUT,<"RESULT = ",J4>,RESULT);
IF RESULT EQL CS_DATAOKV THEN
WRITE(OUT,<"DEST = ",A7>,DEST);
CLOSE(OUT,LOCK);
END.Output
RESULT = 1 DEST = ADCBEFG
In this call, the parameters have the following meanings:
VSN_NUM is an integer passed by reference to the procedure. It specifies the ccsversion to be used. The ccsversion contains the escapement rules.
The following are the values allowed for VSN_NUM:
|
Value |
Meaning |
|
Greater than or equal to 0 |
Specifies a ccsversion. The numbers of the ccsversions are listed in the MultiLingual System Administration, Operations, and Programming Guide. |
|
–2 |
Specifies the system default ccsversion. If the system default ccsversion is not available, an error is returned. |
SOURCE is an EBCDIC array passed to the procedure. It contains the text to be arranged according to the escapement rules.
SOURCE_START is an integer passed to the procedure. It specifies the starting position in SOURCE (0 relative) for the arranging of text by escapement rules to begin.
DEST is an EBCDIC array returned by the procedure. It contains the resulting text after the escapement rules have been applied.
TRANS_LEN is an integer passed to the procedure. It specifies the number of characters to arrange according to the escapement rules.
RESULT is an integer returned by the procedure. It indicates whether or not an error occurred during the execution of the procedure. An explanation of the error result values and messages can be found at the end of this section. The values returned by this procedure include:
|
CS_BAD_ARRAY_DESCRIPTIONV (3000) |
CS_FILE_ACCESS_ERRORV (1000) |
|
CS_BAD_DATA_LENV (3002) |
CS_NO_NUM_FOUNDV (3003) |
|
CS_DATAOKV (1) |
CS_SOFTERRV (1002) |
|
CS_FAULTV (1001) |

