Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript Array function


May 13, 2021 VBScript


Table of contents


VBScript Array function

The VBScript Array function is used to return a variable that contains an array.


VBScript Array function Complete VBScript reference manual

The Array function returns a variable that contains an array.

Note: The first element in the array is zero.

Grammar

Array(arglist)

parameter describe
arglist Required.A list of element values in array (split by commas).

Instance 1

<script type="text/vbscript">

a=Array(5,10,15,20)
document.write(a(3))

</script>

The above example output results:

20

Try it out . . .

Instance 2

<script type="text/vbscript">

a=Array(5,10,15,20)
document.write(a(0))

</script>

The above example output results:

5

Try it out . . .

Instance 3

Traversing all the items in the array:

<script type="text/vbscript">

a=Array(5,10,15,20)
for each x in a
document.write(x & "<br />")
next

</script>

The above example output results:

5
10
15
20

Try it out . . .

VBScript Array function Complete VBScript reference manual