hi,
i'm used to c++! sorry.. i have a very basic question.
in c++, you can dynamically allocate arrays. ie:
int a;
a=some calculation, say a has 100
char * a= new char [a] //this is very very legal and done all the time
in vba, however, i'm having some trouble:
this code crashes on the line:
Dim wcs(numwc) As Long
anyone know if its possible to allocate memory dynamically, or is there some other way to do it? syntax etc?
please note, that the abvoe code is not my real code.. i'm just playing around with arrays right now to see what vba supports and does not support! (my code makes more sense
)
thanks!
i'm used to c++! sorry.. i have a very basic question.
in c++, you can dynamically allocate arrays. ie:
int a;
a=some calculation, say a has 100
char * a= new char [a] //this is very very legal and done all the time
in vba, however, i'm having some trouble:
Code:
Sub test()
Dim numwc As Long
Dim lowlim As Long
Dim uplim As Long
Dim inc As Long
lowlim = 1000
uplim = 5000
inc = 500
numwc = ((uplim - lowlim) / inc) + 1
Dim wcs(numwc) As Long
End Sub
this code crashes on the line:
Dim wcs(numwc) As Long
anyone know if its possible to allocate memory dynamically, or is there some other way to do it? syntax etc?
please note, that the abvoe code is not my real code.. i'm just playing around with arrays right now to see what vba supports and does not support! (my code makes more sense
thanks!