Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.0 ()
DCOUNT Function (DataBasic) (m618703+dcount_f.htm)
Counts the number of elements in a string that are separated by a specified delimiter.
DCOUNT(string, delimiter)
string An expression that evaluates to the string to be searched.
delimiter An expression that evaluates to a single character that separates the string elements. If delimiter contains more than one character, only the first is used.
Note: This behaviour can be changed with the DCOUNT compatibility option.
DCOUNT returns the number of elements in the string that are separated by the delimiter.
DCOUNT can be used to count the number of elements in a dynamic array.
If the delimiter is not contained in the string, a value of 1 is returned.
If the string is null, a value of 0 is returned.
If either string or delimiter is a literal, it must be enclosed in quotes.
If data case insensitive mode is selected (see Case Sensitivity), case is ignored when searching string for delimiter.
A = "123":@AM:"456":@AM:"789" B = DCOUNT(A,@AM)
Assigns a value of 3 to variable B, because there are three elements separated by attribute marks in string A.
X = "" M = DCOUNT(X,"/")
Assigns a value of 0 to variable M, because X is a null string.
A = "THIS.IS.A.TEST" B = DCOUNT(A,":")
Assigns a value of 1 to variable B, because string A does not contain the specified delimiter.