Article ID: 104554
Article Last Modified on 12/9/2003
Global a as string Global b as string Global c as stringyou could have the following code in a Sub procedure:
a = Space(64000) b = Space(64000) c = Space(64000)
Dim a as string Dim b as string Dim c as stringyou could have the following code in a Sub procedure in the same module:
a = Space(64000) b = Space(64000) c = Space(64000)
Sub MySub1()
Dim a As String
Dim b As String
a = Space(32000)
b = Space(32000)
End Sub
Sub MySub2()
Dim a As String
Dim b As String
a = Space(32000)
b = Space(32000)
End Sub
This is true even when more than one of the Sub procedures are currently
active such as when MySub1 is called and it calls MySub2. Both are in
memory and each has a 64K segment available for local variable-length
strings.
Sub MySub3()
Dim a As String
Dim b As String
Dim c As String
a = Space(32000)
b = Space(32000)
c = Space(32000)
End Sub
Type Test
a As String
b As String
c As String
End Type
Dim x as Test
you can have the following code in a Sub procedure:
x.a = Space(64000) x.b = Space(64000) x.c = Space(64000)
Dim MyArray(12) as StringThe following code in a Sub procedure would cause an error:
MyArray(1) = Space(64000) MyArray(2) = Space(64000)To solve the problem, dimension the array as type Variant:
Dim MyArray(12) as VariantThen the following Sub procedure code will correctly create two 64K variants tagged as strings.
MyArray(1) = Space(64000) MyArray(2) = Space(64000)
Additional query words: 2.00 3.00
Keywords: KB104554