Current location: Hot Scripts Forums » Programming Languages » ASP » count the number of words


count the number of words

Reply
  #1 (permalink)  
Old 09-08-03, 02:23 AM
aspuser25 aspuser25 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Question count the number of words

how can i count how many words have i written in a text area???

Like taking an example ... i am writing in this textarea of HotScripts forumns. and say in total i have written 50 words .. how can find out this information?

thanks
Reply With Quote
  #2 (permalink)  
Old 09-08-03, 04:48 AM
andreasberglind andreasberglind is offline
Newbie Coder
 
Join Date: Jul 2003
Location: Sweden
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
RE: count the number of words

Hey. Couldnīt you just load the text from the text area into a string, and then loop through it and count the spaces in the string? I think that should work...
Reply With Quote
  #3 (permalink)  
Old 09-08-03, 07:55 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
traditionally i would say find a javascript to do it. But if you insist on ASP then the contents of the input must be made into a string. then split into an array (as would be done in javascript)


<%
' Put form contents into a variable
In_String = Request.Form("Input_Name")

' Split the string into an array, separated by a space
WordArray = Split(In_String, " ")

' Count the array rows
Word_Count = UBound(WordArray) + 1
' We must add 1 because arrays are zero based (0, 1, 2 etc)

%>


sorted.
Reply With Quote
  #4 (permalink)  
Old 10-06-03, 05:19 PM
relledge's Avatar
relledge relledge is offline
Wannabe Coder
 
Join Date: May 2003
Location: Overland Park, KS
Posts: 162
Thanks: 0
Thanked 0 Times in 0 Posts
HotScripts.com uses JavaScript to do it ... we even found the code by searching HotScripts.com! Amazing what cool things you can find on HotScripts.com!
__________________
EOT

RElledge
www.HotScripts.com
'These Scripts are Hot!'
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
looking for a banned words list cath Script Requests 6 10-29-03 06:18 PM
Post count, why? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 7 10-06-03 03:29 PM
drop the lowest number TheLaughingBandit ASP 2 08-30-03 01:57 PM
BUG - number of members surebetdmg HotScripts Site Bug Reports 2 08-10-03 04:35 PM
auto number superman PHP 1 06-30-03 09:53 AM


All times are GMT -5. The time now is 03:25 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.