|
-
Jun 24th, 2001, 05:48 AM
#1
Thread Starter
Lively Member
Help with Text
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?
-
Jun 24th, 2001, 05:54 AM
#2
dim iPos as integer
ipos=1
for i = 1 to 3
vArray(i) = mid(stringval,ipos,30)
ipos=ipos+30
next
-
Jun 24th, 2001, 06:03 AM
#3
Addicted Member
Or...
Array(1) = Left$(str, 1, 30)
Array(2) = Mid$(str, 31, 30)
Array(3) = Right$(str, 30)
-
Jun 24th, 2001, 06:09 AM
#4
Thread Starter
Lively Member
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.
-
Jun 24th, 2001, 06:13 AM
#5
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|