
bag_count(+BagHandle, -Count)

   Get the number of entries in a bag

Arguments
   BagHandle           A bag
   Count               A variable or integer

Type
   Non-logical Variables, Arrays, Bags, Shelves and Stores

Description
	This returns an integer corresponding to the number of entries
	currently in the bag. A fresh or erased bag has zero entries.
    

Modes and Determinism
   bag_count(+, -) is det

Exceptions
     4 --- BagHandle is not instantiated
     5 --- BagHandle is not a bag
    40 --- BagHandle refers to an already destroyed bag

Examples
   
    ?- bag_create(B), bag_count(B, N0), bag_enter(B, one), bag_count(B, N1).
    N0 = 0
    B = $&(bag,"371bnb")
    N1 = 1
    Yes (0.00s cpu)
    

See Also
   bag_create / 1, bag_enter / 2, bag_count / 2, bag_erase / 1, bag_abolish / 1, bag_retrieve / 2, bag_dissolve / 2
