DataBasic Reference > Statements and Intrinsic Functions > D > DCOUNT Function

Comment on this topic

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.

RealityV15.1Online Documentation (MoTW) Revision 7

DCOUNT Function (DataBasic) (m618703+dcount_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

DCOUNT Function

Counts the number of elements in a string that are separated by a specified delimiter.

Syntax

DCOUNT(string, delimiter)

Syntax Elements

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.

Operation

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.

Case Insensitivity

If data case insensitive mode is selected (see Case Sensitivity), case is ignored when searching string for delimiter.

Examples

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.

RealityV15.1 (MoTW) Revision 7Comment on this topic