|
-
Nov 15th, 2006, 08:20 AM
#1
Thread Starter
New Member
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
-
Nov 15th, 2006, 08:35 AM
#2
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:
Dim txtArray () as string
for i=1 to len(YourText)
redim preserve txtArray(i)
txtarray(i)=left(YourText,YourLenght)
YourText=right(youtext,len(YourText)-YourLenght)
next i
To show these strips use something like
VB Code:
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!
-
Nov 17th, 2006, 04:55 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|