Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Coutnting the char. & string in text area.?

Posted on 2001-09-14
4
Medium Priority
?
160 Views
Last Modified: 2010-05-02
Hello,

       I have to count the strings & char entered by the user in the text area on cliking the button.
Means to say when the button is clicked  a list box shows the tollal count for all characters entered in the text area like A=78 , n=68 , .=90 & so on .
Plz give me the solution to do this.
Thanx for giving me answer.
0
Comment
Question by:arzoo
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Bahnass earned 200 total points
ID: 6484380
dim AllAscii(256)

for I = 1 to len(Text1.text)
    AllAscii(asc(mid(AllAscii(I))))=    AllAscii(asc(mid(AllAscii(I))))+1

next

'   then to get that array
for i =1 to 255
    ?     AllAscii(I),
next
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6484391
along the same line

Function AscVal(strInput As String)
Dim RetVal As String, I as long

For I = 1 To Len(strInput)
    RetVal = RetVal & Asc(Mid(strInput, I, 1))
Next I

AscVal = RetVal
End Function

in your code you can use

lngTextValue = AscVal(Textbox1.Text)

:O)Bruintje
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6484392
'Here is the solution
'u can put the cnt any where u want,like list box or text
'box.

Private Sub Command1_Click()

Dim cnt As Integer
Dim i As Integer

For i = 1 To Len(Text1.Text)
    cnt = cnt + Asc(Mid(Text1.Text, i, 1))
Next

MsgBox cnt

End Sub
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6484408
Questions Asked 9
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Answers  
Questions Answered 0
Last 10 Grades Received  

arzoo u have bad credentials,be prompt.
I also suggest all who read,check their crdentials so thatu will spare ur precious time for a worthy person
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question