A puzzle for Gurus ! 
Author Message
 A puzzle for Gurus !

Just put into code what you do visually...

sentence = "This is a complete sentence."
'===
'remove punctuation
'===
punctuation = ",.:;""'()[]{}" 'your list may vary...
for n = 1 to len(punctuation)
 work = replace(sentence,mid(punctuation,n,1), " ")
next
'===
'normalize spacing...
'===
do while instr(work, "  ")
 work = replace(sentence,"  ", " ")
loop
'===
'split into words
'===
words = split(trim(work), " ")

if ubound(words) = -1 then
    'we could have figured this out sooner ;-)...
    msgbox "Phantom sentence..."
else
  msgbox "Sentence contains " & ubound(words) + 1 & " words"
  msgbox "The first word is: " & words(0)
  msgbox "The last word is: " & words(ubound(words))
end if

--
Michael Harris
MVP Scripting



Can you give me a pointer, or show a code how to accomplish this:

I want the user to enter a sentence into a textbox. I want to take this
sentence and break it down into single words, then I want to take these
single words and assign them into unique (different for each word)
variables.

Thank you.



Sun, 22 Sep 2002 03:00:00 GMT  
 A puzzle for Gurus !
Can you give me a pointer, or show a code how to accomplish this:

I want the user to enter a sentence into a textbox. I want to take this
sentence and break it down into single words, then I want to take these
single words and assign them into unique (different for each word)
variables.

Thank you.



Mon, 23 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A puzzle for Gurus !

2. Here's a puzzle for the VB gurus

3. Question for a guru (WOSA guru, that is)

4. GURU/SEMI-GURU please help with ActiveX DLL threading question

5. CIEBasedABC puzzle

6. two puzzles

7. puzzling PS file from PDF

8. "If Else - Include" Puzzle

9. Ghostscript, mswinpr2, PS, PDF, print quality puzzle

10. Puzzled: Why doesn't this work?

11. A PostScript Puzzle (read on)

12. A PostScript Puzzle (read on)

 

 
Powered by phpBB® Forum Software