Solved

Coutnting the char. & string in text area.?

Posted on 2001-09-14
4
146 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 50 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

810 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