Vb-Scripting Array Function

Function Name:- Array

Meaning :- Used to creating Arrays(Returns Array type Variant)

Syntax:- Array(Arguments)

  • Arguments are comma separated 
  • No Arguments are given 0 length array is created


  • Dim aNum
  • aNum = Array(“Helping”,”People”,”Learn”,””)
  • Msgbox aNum(0) ‘Returns Helping
  • Msgbox aNum(1) ‘Returs People
  • Msgbox aNum(2) ‘Returns Learn
  • Msgbox aNum(3) ‘Returns
  • Msgbox aNum(4) ‘Throws Subscript out of range exception as Array has 4 values

Difference between Array and Dictionary
Interview Questions on Array?

Leave a Reply

Your email address will not be published. Required fields are marked *