Home|Management Portal|Index
Caché MultiValue Basic Reference
SEQS
« »
   
Server:docs.intersystems.com
Instance:CACHE20081
User:UnknownUser
 
-
Search:    

Returns the character code for the first character of each element in a dynamic array.
Synopsis
SEQS(dynarray)
Arguments
dynarray Any valid dynamic array.
Description
The SEQS function takes a dynamic array and returns the corresponding numeric codes for the first character in each element. It returns these character codes as a dynamic array. If an element consists of a string of more than one character, SEQS returns the numeric value of the first character of that element. If an element contains an uninitialized variable or a null string, SEQS returns -1 for that element.
If the first character of a dynamic array element is one of the following dynamic array level delimiters: CHAR(252), CHAR(253), or CHAR(254), SEQS treats this character as a level delimiter, and returns -1 for the null element(s) established by parsing this character as a level delimiter.
Note:
UNISEQS and SEQS are functionally identical. On Unicode systems both can be used to return character codes for 16-bit Unicode characters. On 8-bit systems, these functions return that character code of the first 8 bits of a 16-bit Unicode character.
The CHARS function is the inverse of SEQS. It takes a dynamic array of numeric codes and returns the corresponding characters.
The SEQ function (or UNISEQ function) takes the first character of a string and returns the corresponding numeric code.
The SEQS function returns the numeric value for the first character of each element as a dynamic array element. The corresponding Caché ObjectScript $ASCII function can take a string of characters and return the numeric value for a specific character by specifying its position in the string.
Examples
The following example uses the SEQS function to return the numeric codes associated with each character in a dynamic array:
alpha="A":@VM:"B":@VM:"C":@VM:"D"
PRINT SEQS(alpha)
      ! returns 65v66v67v68
The following example returns the numeric codes associated with four lowercase Russian letters in a dynamic array. On a Unicode system, it returns the Russian character codes. On an 8-bit system, characters beyond 255 are treated as null strings, so SEQS returns -1 for each element.
russian=CHAR(1072):@VM:CHAR(1073):@VM:CHAR(1074):@VM:CHAR(1075)
PRINT SEQS(russian)
See Also