VBScript Array Function | Rookie Tutorial
Rookie Tutorial -- Learning is not only technology, but also dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
VBScript Array Function
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 | 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
Example 2
<script type="text/vbscript">
a=Array(5,10,15,20)
document.write(a(0))
</script>
Output of the above example:
5
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
YouTip