ListSize()

语法

Result = ListSize(List())
概要
Returns the number of elements in the list. It does not change the current element. This function is very fast (it doesn't iterates all the list but uses a cached result) and can be safely used to determine if a list is empty or not.

参数

List() The name of your list variable, created with the NewList function. You must include the brackets after the list name.

返回值

The total number of elements in the list.

示例

  NewList countme.w()

  ; Small loop to add some elements to the list.
  For i=0 To 10
    AddElement(countme())
    countme() = i * 23
  Next

  ; Show how many elements there are in the list. I hope you thought
  ; of the same value as this example ;)
  MessageRequester("Information", "There are "+Str(ListSize(countme()))+" elements in the list", #PB_MessageRequester_OK)

参阅

ListIndex()

已支持操作系统

所有

<- ListIndex() - List Index - MergeLists() ->