Solved

Coutnting the char. & string in text area.?

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now