Results 1 to 5 of 5

Thread: Help with Text

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    A pub that sells Kronenburg
    Posts
    116

    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?

  2. #2
    Resty
    Guest
    dim iPos as integer
    ipos=1
    for i = 1 to 3
    vArray(i) = mid(stringval,ipos,30)
    ipos=ipos+30
    next

  3. #3
    Addicted Member stevess's Avatar
    Join Date
    May 2001
    Posts
    251
    Or...

    Array(1) = Left$(str, 1, 30)
    Array(2) = Mid$(str, 31, 30)
    Array(3) = Right$(str, 30)

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2001
    Location
    A pub that sells Kronenburg
    Posts
    116
    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.

  5. #5
    Addicted Member stevess's Avatar
    Join Date
    May 2001
    Posts
    251
    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
  •  



Click Here to Expand Forum to Full Width