Skip to content
Related Articles

Related Articles

ASP Count Property

View Discussion
Improve Article
Save Article
  • Last Updated : 19 Mar, 2021

The ASP Count Property is used to return the number of key-value pairs currently present in the Dictionary Object. 



Example: The below code demonstrates the ASP Dictionary.Count Property. 


dim dict
'Create a new dictionary
set dict=Server.CreateObject("Scripting.Dictionary")
'Add values to the dictionary
dict.Add "p","physics"
dict.Add "c","chemistry"
dict.Add "m","maths"
'Count the number of key-value pairs
Response.Write("Current number of entries: " & dict.Count)
'Add one more value
dict.Add "b","biology"
'Count the number of key-value pairs again
Response.Write("<br>Current number of entries: " & dict.Count)
set dict=nothing


Current number of entries: 3
Current number of entries: 4
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!