YouTip LogoYouTip

Vb Func Array

VBScript Array Function | Rookie Tutorial

VBScript Array Function | Rookie Tutorial

Rookie Tutorial -- Learning is not only technology, but also dreams!

VBScript Tutorial VB Tutorial VB Usage VB Variables VB Procedures VB Conditionals VB Looping VB Summary VB Examples VB Functions VB Keywords VBScript Examples VBScript Keywords Deep Dive Scripting Languages Script Software Development Tools Scripting Programming Languages Web Service Web Design and Development Computer Computer Hardware

VBScript Array Function


Image 3: VBScript Reference Manual Complete VBScript Reference Manual


Array function returns a variable containing an array.

Note: The first element in the array is zero.

Syntax

 Array(arglist) 
Parameter
Parameter Description
arglist Required. A list of element values in the array (comma separated).

Examples

Example 1

<script type="text/vbscript">

 a=Array(5,10,15,20)

 document.write(a(3))

</script>

Output of the above example:

 20 

Try it »

Example 2

<script type="text/vbscript">

 a=Array(5,10,15,20)

 document.write(a(0))

</script>

Output of the above example:

 5 

Try it »

Example 3

Iterate through all 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>

Output of the above example:

 5

 10

 15

 20

Try it »


Image 4: VBScript Reference Manual Complete VBScript Reference Manual

← Func FilterFunc Tan β†’