Dim sum as string
sum = a,b,d,a,d,c...
I want to count the variable
Code some thing like this
if sum = "a" then
count(sum)
elseif sum = "b" then
count(sum)
....
end if
expected output
a = 2
b = 1
c = 1
d = 2
How to do this in vb6
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the items are single characters, then you can replace them with a blank string and count the difference in length:
You can also just loop through counting the occurances.
If the strings will be longer, you will need to use the Split() function and then check each item in turn:
You should be able to easily convert this to handling all the possible values.