COUNT()

COUNT(N)

RETURNS THE NUMBER OF ITEMS OF THE SYSTEM OBJECT NUMBER N

  • Type: Function
  • Parameter: 1
  • Group: System Objects

ACTION

The function COUNT(N) returns the number of lines (items) of the system object designated by its number N.

The system object is of type : MEMO, COMBO, LIST, MEMO_RICH, DLIST, SERIAL, SYNEDIT.

Remark: the first line has the number 1.

SYNTAX: Result=COUNT(N)

  • N = system object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of system objects.

USE

  • The function COUNT() is used to know the size (the number of items) of an object handling a list.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of system objects.
  • If number N is less than 0.
  • If the system object number N does not exist.
  • If the object number N is not of type : MEMO, COMBO, LIST, MEMO_RICH, DLIST, SERIAL, SYNEDIT.

EXAMPLE

rem create a LIST

list 1

rem fill the LIST with 2 lines

item_add 1,"This is line 1"

item_add 1,"This is line 2"

print

print

print

print

print

print

rem print the number of items

print "Nbre of lines="+str$(count(1))

SEE ALSO

MEMO

COMBO

LIST

MEMO_RICH

DLIST

SERIAL

SYNEDIT

FILE_ADD

ITEM_ADD

ITEM_INSERT

ITEM_DELETE

ITEM_READ$()