KG Old Wolf
Board Regular
- Joined
- Sep 20, 2009
- Messages
- 65
This is a perfect use of an array and I am missing something very basic.
I am trying to load a surname variable into an array and then index through each element to inspect and assign a value (part of a SOUNDEX routine). I ReDim the array with the length of the surname but the entire surname loads into the first array element and I can't access a single letter (I get the entire name). Below is a simple code snippet. Suggestions greatly appreciated!
Sub KG()
wrk_string = "Test"
wrk_length = Len(wrk_string)
ReDim ary_last_name(1 To 1)
ary_last_name(1) = wrk_string
ReDim ary_last_name(1 To wrk_length)
MsgBox (ary_last_name(2))
End Sub
I am trying to load a surname variable into an array and then index through each element to inspect and assign a value (part of a SOUNDEX routine). I ReDim the array with the length of the surname but the entire surname loads into the first array element and I can't access a single letter (I get the entire name). Below is a simple code snippet. Suggestions greatly appreciated!
Sub KG()
wrk_string = "Test"
wrk_length = Len(wrk_string)
ReDim ary_last_name(1 To 1)
ary_last_name(1) = wrk_string
ReDim ary_last_name(1 To wrk_length)
MsgBox (ary_last_name(2))
End Sub