Hiya,
I have some text which is 90 characters in length. I need to split this up into 3 seperate string arrays (30 characters in length each). How do I do this?
Printable View
Hiya,
I have some text which is 90 characters in length. I need to split this up into 3 seperate string arrays (30 characters in length each). How do I do this?
dim iPos as integer
ipos=1
for i = 1 to 3
vArray(i) = mid(stringval,ipos,30)
ipos=ipos+30
next
Or...
Array(1) = Left$(str, 1, 30)
Array(2) = Mid$(str, 31, 30)
Array(3) = Right$(str, 30)
thank you peeps.
however, i still have a problem. The last word on the line is being split up. i.e i am a crap progra
mmer
is there any way of moving 'programmer' to the line below and carrying on from there? but, by doing this would create a chance of requiring another line which I don't want to do. All 90 characters have to be shown in 3 lines.
I hope the above makes sense!!
Regards.
It makes sense, but it greatly complicates the matter. If you are limited to 30 chars per line, and you have 90, then there is no way to avoid a fourth line if you have make one of them 25 to avoid chopping a word in half.