English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am supposed to be able to look up states by their full names and abbreviated names, but I don't know how to do this with out using a list, or combo box.

2007-03-20 07:49:33 · 3 answers · asked by huelsman_royalty 2 in Computers & Internet Programming & Design

3 answers

dim aryStateNames(50) as string

'This is your array of state names

dim aryStateAbbr(50) as string

'This is your array of abbreviations

To Search Through Them:

If len(srchTxt) = 2 then
'if the length of the string is 2 characters long, then search through aryStateAbbr using a for loop or while.
Else
'Search through aryStateNames

I won't give you the rest, but this should be enough to spark your own ideas.

Good Luck!

2007-03-20 08:42:01 · answer #1 · answered by sheket 1 · 0 0

First, declare the Variable array with the number of subscripts you'll need:


Dim aryArray(9)

This shows a one dimensional array with 9 "containers".


Let's say you want to the numbers 1 through 9 in the array:

Dim x as Integer

For x = 1 to 9

aryArray(x) = x

Next

And so the line:

Print aryArray(3) + aryArray(4)

will print the number "7".

Let's say you want text in the array:

aryArray(1) = "AAA"
aryArray(2) = "BBB"
aryArray(3) = "CCC"
aryArray(4) = "DDD"
aryArray(5) = "EEE"
aryArray(6) = "FFF"
aryArray(7) = "GGG"
aryArray(8) = "HHH"
aryArray(9) = "III"

then the line:

Print aryArray(3) + aryArray(4)

would print:

"CCCDDD"

Hope this helps

2007-03-20 15:51:21 · answer #2 · answered by Brooklyn_SS 2 · 0 0

Go to the library and get a good book on this subject and there are many available. I like "The Complete Idiot's Guides" (which are good for people who do not have much knowledge about a subject) and "The Dummies Guides' (which are good for people who need to solve a problem quickly).

2007-03-20 15:37:11 · answer #3 · answered by Denise T 5 · 0 0

fedest.com, questions and answers