Arrays can be one of the most useful things you can use. They will take a lot of work out of writing code once you've mastered them. Not only will it make your job easier but you can do quite a lot with just a little bit of code.
Nuts Own Code

Asp Directory

Nuts Web Search
Web Directory
Web Search

Nuts ASP Code
Functions
Scripts
Tutorials
Wizards
Fonts
Download Fonts
Download Dll Files
Dll Files
Relaxing Games
Online Games
Take Our Poll
Do you use .Net?
Yes
No
Not Yet
Dot What?
Really, Take It!
Get The Source
About Nuts4Asp
Privacy
Contact Us
Arts
Movies, Television, Music
Business
Jobs, Industries, Investing
Computers
Internet, Software, Hardware
Games
Video Games, RPGs, Gambling
Health
Fitness, Medicine, Alternative
Home
Family, Consumers, Cooking
Kids and Teens
Arts, School Time, Teen Life
News
Media, Newspapers, Weather
Reference
Maps, Education, Libraries
Regional
US, Canada, UK, Europe
Science
Biology, Psychology, Physics
Sports
Baseball, Soccer, Basketball
World
Deutsch, Español, Français, Italiano, Japanese, Nederlands, Polska, Svenska
Help build the largest human-edited directory of the web
<%
Dim arrNuts(2)

arrNuts(0) = "Nuts"
arrNuts(1) = "4"
arrNuts(2) = "asp.com

Response.Write arrNuts(0) & arrNuts(1) & arrNuts(2)
%>

The result would be: Nuts4asp.com

Now you may be wondering, Why did he dimension his array as 2 when there are three parts to it. Well, arrays are ZERO based so even though there are three parts, it actually counts the first a zero so instead of it counting 1, 2, 3, it counts 0, 1, 2.

Now let's go a little further and Split a string into an array.

<%
Dim strNuts, arrNuts

strNuts = "Learn about arrays now"

arrNuts = Split(strNuts," ")

For i = 0  to UBound(arrNuts)
Response.Write arrNuts(i) & "<br>"
Next
%>

This would write:
Learn
about
arrays
now

Here's basically what happened.

Split() took the string and cut it up every where it found a blank space. This gave us each individual word. For  i = 0 is starting a loop and setting i to zero which is the lowest number in an array. Now to UBound(arrNuts) is telling the loop how many times to loop. UBound simply means UPPER BOUND or the highest number in the array. In this case it said start at 0 and loop to 4 (this gives us 5 remember arrays are ZERO based. The next line:
Response.Write arrNuts(i) & "<br>"
arrNuts(i) What is the i there for? remember we told this loop i = 0. Now why is the an ampersand and a break tag?
Well, the & is used to concatenate (glue together) the break tag and the array so it will write the array and then move down a line when it performs it' next action. The word NEXT tells it to do it all over again with the next word in our array.

And there it is, a very basic, simply spoken set of array examples.

To get a grasp of the split function look here.

Someday arrays will come in useful to you. If you want to see a working example of one, take a look at Simple Counter Using Graphics

Bad or missing query parameters in request.

Copyright © 2001-2008 Nuts4Asp.com
All other names used are property or copyright of their respective owners.