Array Question

jmriddic

Registered User.
Local time
Today, 09:41
Joined
Sep 18, 2001
Messages
150
Hi all,

This a general question but how much can each element(cell) of an array hold. I use them for VBA and word automation and I parse per carriage return and noticed that a paragraph's last three sentences got lopped off by the array cell when the data was put into Word. It was a pretty long paragraph.
 
Answer?

MyString = (CStr(Forms!HumanResourcesForm3!Assessment1))
MyArray = Split(MyString, vbCrLf, -1, 1)
ArraySize = UBound(MyArray)

Its declared as an integer but it holds text.
 
That could be the problem.

Each cell in the array is big enough to hold a data item of the type its declared as, so an integer array can hold an integer in each of its cells(probably up to long int size). If its storing text, then i expect its using the ascii values concatenated together to form the integer value
 
Try declaring it as a long.. or use the correct datatype for it. Possibly a Variant in this case if you're using it for more than one thing.
 

Users who are viewing this thread

Back
Top Bottom