|
|
#1 |
|
Addicted Member
Join Date: Jul 06
Posts: 131
![]() |
i have a richtextbox
if i clicked any word i need to get the number of the same words in the text which are befor the word clicked example text: University of Liverpool Founded in 1881, the University of Liverpool has earned an international reputation for high quality and is one of the most highly respected educational institutions in the UK. It has been associated with no fewer than eight Nobel Laureates. Laureate Online Education, formerly known as KIT eLearning, has acted as the e-learning partner of the University of Liverpool since 1999. It specialises in delivering 100% online academic education on a global basis - tailored for the needs of working professionals worldwide. Laureate Online Education has developed Europe's truly international online Master programmes, using specially adapted versions of University of Liverpool campus-taught degrees. if i clicked the word University that is underlined i should get the value =3 by ignoring the last word because it cames after the one choosen how can i do this |
|
|
|
|
|
#2 |
|
Re: count the number of words
VB Code:
__________________
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Private Message Viewer • Copy/Paste VB Code • Paste VB Code Add-In • Insert Procedure Names Add-In • A calculator for the game of Spider • My review of REALbasic 2008 • VB6 Debug Tutorial • Picture Viewer • VBF Photo Contest Winners Please go to the Thread Tools menu and click Mark Thread Resolved when you have your answer. If someone helped you today then please consider rating their post. |
|
|
|
|
|
|
#3 |
|
Addicted Member
Join Date: Jul 06
Posts: 131
![]() |
Re: count the number of words
i need the code to be general for any word
University is just an example and what is MyData ? |
|
|
|
|
|
#4 |
|
Fanatic Member
Join Date: Nov 06
Location: Near San Francisco
Posts: 833
![]() |
Re: count the number of words
Why not count the spaces.
Code:
For a=1 to len(LineOfText)
if Mid(LineOfText(a,1)=" " then Count=count+1
next a
' and for the last word of the sentence
count=count+1
__________________
Alpha Micro: Alpha Basic, AS400 V5r2, EDI (Trusted Link/ Inovis.com),Access AS/400 via VB6, Qbasic for data conversions. A mix of Hardware too. ASCII Table , New Number to Words/66 digits , AS/400(v5r2) VB6 Viewer/Ask for code(ODBC) ^ What Is Transferring? , Check your Ports #Perfect Passwords , *Slide Bar Example , Logoff, Restart, Shut-Down PC *Keep Form On Top , Opaque Form ^ Create Objects at Run Time @ Check Key Caps Locks # GetTickCount(System Up Time) * Convert text to Excel & Collected Icons + Resize: Form/Text box ^ PC GateWay via Shell $ Drag & Drop Game ! PopUpMenu *Print File/no Open# Timer on Mult Forms ~ Splash & Mult Forms & Lots of Comments + Random/Timer/Guess * Dec >Hex >Oct >Bin % Get MAC (NIC) < saving to Registry > Wookiee Cookies \ BackUpDisk / World Conection SpeedTest $ Glossary Commonly Used Terms # phonetic list @ Detailed Computer Scan When posting Code, Use tags.. [code ] *Your Code* [/code ] |
|
|
|
|
|
#5 | |
|
Re: count the number of words
Quote:
VB Code:
__________________
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Private Message Viewer • Copy/Paste VB Code • Paste VB Code Add-In • Insert Procedure Names Add-In • A calculator for the game of Spider • My review of REALbasic 2008 • VB6 Debug Tutorial • Picture Viewer • VBF Photo Contest Winners Please go to the Thread Tools menu and click Mark Thread Resolved when you have your answer. If someone helped you today then please consider rating their post. |
||
|
|
|
|
|
#6 |
|
Addicted Member
Join Date: Jul 06
Posts: 131
![]() |
Re: count the number of words
MartinLiss
this code will count all words in the text and i need it to stop counting when it reaches the word selected i.e # words befor selected |
|
|
|
|
|
#7 |
|
Fanatic Member
Join Date: Nov 06
Location: Near San Francisco
Posts: 833
![]() |
Re: count the number of words
Yes, I saw that after I posted. I must remember to read the thread i.e. all the words not just the ones I like.
__________________
Alpha Micro: Alpha Basic, AS400 V5r2, EDI (Trusted Link/ Inovis.com),Access AS/400 via VB6, Qbasic for data conversions. A mix of Hardware too. ASCII Table , New Number to Words/66 digits , AS/400(v5r2) VB6 Viewer/Ask for code(ODBC) ^ What Is Transferring? , Check your Ports #Perfect Passwords , *Slide Bar Example , Logoff, Restart, Shut-Down PC *Keep Form On Top , Opaque Form ^ Create Objects at Run Time @ Check Key Caps Locks # GetTickCount(System Up Time) * Convert text to Excel & Collected Icons + Resize: Form/Text box ^ PC GateWay via Shell $ Drag & Drop Game ! PopUpMenu *Print File/no Open# Timer on Mult Forms ~ Splash & Mult Forms & Lots of Comments + Random/Timer/Guess * Dec >Hex >Oct >Bin % Get MAC (NIC) < saving to Registry > Wookiee Cookies \ BackUpDisk / World Conection SpeedTest $ Glossary Commonly Used Terms # phonetic list @ Detailed Computer Scan When posting Code, Use tags.. [code ] *Your Code* [/code ] |
|
|
|
|
|
#8 |
|
Addicted Member
Join Date: Jul 06
Posts: 131
![]() |
Re: count the number of words
thanks ZenDisaster
this is good but i need to get the count# without changing colors |
|
|
|
|
|
#9 |
|
Addicted Member
Join Date: Jul 06
Posts: 131
![]() |
Re: count the number of words
Yes
thats itcan it ignor any word between brackets i mean if the same word was between ( ) it wil not be counted there may be more than one word between ( ) example: University of Liverpool Founded in 1881, the (University of Liverpool has earned )an international reputation for high quality and is one of the most highly respected educational institutions in the UK. It has been associated with no fewer than eight Nobel Laureates. Laureate Online Education, formerly known as KIT eLearning, has acted as the e-learning partner of the University of Liverpool since 1999. It specialises in delivering 100% online academic education on a global basis - tailored for the needs of working professionals worldwide. if i choose the underlined word it should return 2 so it will ignor the word which is between ( ) Last edited by om-yousif; Dec 26th, 2006 at 01:39 PM. |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|