Customer Login  .   Webmail Login  .   About Us  .   Contact Us
Go to: Articles List

Arrays How To Part 2 : Functions related to arrays explained
[Part 1 | Part 2 | Part 3 | Part 4]

There are three main functions related to Arrays that you should be aware of: LBound(), UBound(), and Split(). I will define each and explain when to use each of them.

LBound(ArrayName[, ArrayDimension])
- Returns the lowest element available in an array, usually 0.
- ArrayName is any valid array
- ArrayDimension is an option parameter, it specifies which dimension of the array you want to find the lower bound of.
- ArrayDimension defaults to 1, so if you are checking a 1 dimensional array or you want to check the first dimension you can leave this out.

UBound(ArrayName[, ArrayDimension])
- Returns the highest element available in an array.
- ArrayName is any valid array
- ArrayDimension is an option parameter, it specifies which dimension of the array you want to find the upper bound of.
- ArrayDimension defaults to 1, so if you are checking a 1 dimensional array or you want to check the first dimension you can leave this out.
- If your array has 10 elements (remember zero base) then the upper bound would be 9.

Split(StringToSplit[, DelimiterToUse, HowMany])
- Returns a one dimensional array
- StringToSplit is any valid string
- DelimiterToUse is the character that you want the string to be split by.
- HowMany is the number of elements you want to limit the array to.
- DelimiterToUse and HowMany are optional parameters.
- If you leave out the DelimterToUse, the function uses a space to split the string.

Example:

Dim MyString, MyArray
MyString = "apples,oranges,grapes"
MyArray = Split(MyString, ",")


Result:
A one dimensional array called MyArray with 3 elements.

Shared Hosting
Rookie
Pro
Advanced
Dedicated Servers
BASE
BUSINESS
ENTERPRISE
Why Choose Brinkster?
Radical Support
Brinkster Datacenter
Brinkster Network
Corporate Social Responsibility
90 Day Money Back Guarantee
Unsurpassed Value
Client Testimonials
Additional Features
Antivirus
Merchant Account
E-Commerce
Live Chat Communicator
Free Firewall
Website Builder
Free Web Hosting
Support
General Support
Codebank Search
Forums
Articles
Click here for Brinkster Live Chat
Home   Domains   Shared Hosting   Dedicated Hosting   Partner   Support   About Us    Contact Us   Webmail
Copyright © Brinkster Communications Corporation All Rights Reserved. Privacy Policy & Legal