Results 1 to 3 of 3

Thread: cut-up of texts

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    4

    cut-up of texts

    dear everyone,

    i am trying to build a very simplified cut-up engine, which consists of:
    -the user giving: a text; a choice of wordlength for each strip of words to have
    -the program then cutting up the text in the chosen strip-length (with split, i suppose)
    -and returning the word-strips in a random order (with hyphens after 1, 2, 3 or 4 strips, this again chosen randomly)
    can anyone help?


    thanks a lot if you can, also if you can't,
    love,
    marton

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: cut-up of texts

    Since you want the text been split up at a specific number of characters "SPLIT" won't help.

    Do something like this
    VB Code:
    1. Dim txtArray () as string
    2.  
    3. for i=1 to len(YourText)
    4.   redim preserve txtArray(i)
    5.   txtarray(i)=left(YourText,YourLenght)
    6.   YourText=right(youtext,len(YourText)-YourLenght)
    7. next i

    To show these strips use something like

    VB Code:
    1. Label.Caption=txtArray(int(rnd()*ubound(txtarray))+1)

    all Pseudocode, not tested
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    4

    Re: cut-up of texts

    thanks a lot for the reply; however, i didn't express myself exactly and you couldn't understand: what i meant by wordlength is the word-amount. hence:
    -the user giving: a text; a choice of the amount of words for each strip to have
    -the program then cutting up the text in the chosen strip-length (length meaning amount of words)
    -and returning the word-strips in a random order (with hyphens after 1, 2, 3 or 4 strips, this again chosen randomly)
    sorry for this...

    all the light and jolly, jelly phosphorescent thanks,
    marton

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