本节包含返回有关所指定数组的信息的函数的简要描述。
函数 | 用途 |
---|---|
arraytostring | 给定数组数据、起始模式、结束模式和分隔符,将返回字符串。 |
elementcount | 将返回数组中的非 null 元素或非空元素的数目。 |
nextelement | 给定数组字段和数组中的下标,将返回下一个非空条目和非 null 条目;如果未提供任何内容,那么将返回 0。 |
elementcount(array_field)
其中 array_field 是包含源数据的数据字段。A = ("", , "", "alpha", ,"") => elementcount(A) = 1; sizeof (A) = 6
B = (0 , , 0 , 100 , , 0) => elementcount(B) = 4; sizeof (B) = 6
请注意,在字符串数组中,并不将空字符串计算在内,但是在数字数组中会将每个数目计算在内。换句话说,没有空数目。
此函数对于处理参与者和附件数组很有用。
nextelement(array_field, index_expr)
其中:参数 | 描述 |
---|---|
array_field | 其中包含源数据的数据字段。 |
index_expr | 应当用来开始搜索的下标。如果它是 0,那么将从数组的开头开始搜索。 |
A = ("", , "", "alpha",,"") B =(0 , , 0 , 100 , , 0)
nextelement (A, 0) = 4
nextelement (A, 4) = 0
nextelement (B, 0) = 1
nextelement (B, 1) = 3
nextelement (B, 3) = 4
nextelement (B, 4) = 6
nextelement (B, 6) = 0
此函数对于处理参与者和附件数组很有用。
arraytostring(array_field, begin_expr, end_expr, separator_expr)
其中:参数 | 描述 |
---|---|
array_field | 其中包含源数据的数据字段。 |
begin_expr | 用于标记数组开头的文本字符串。 |
end_expr | 用于标记数组末尾的文本字符串。 |
separator_expr | 用来对数组中的元素进行分隔的文本字符串。 |
arraytostring(MyXMLField, ("<tag><value>", "</value></tag>", "</value><value>")