Hi,can anyone tell me How to found the number of 1's and 2's in the given format 1,1,2,2,3,3,4,2 using vbscript
Thanks in advance
Answer Posted / rajesh
str= "1,1,2,2,3,3,4,2"
arr = split(str,",")
for i =0 to ubound(arr) step 1
if arr(i) = "1" then
counter = counter + 1
elseif arr(i) = "2" then
counter1 = counter1 + 1
elseif arr(i) = "3" then
counter2 = counter2 + 1
elseif arr(i) = "4" then
counter3 = counter3 + 1
end if
next
msgbox "No of 1's :- " & counter
msgbox "No of 2's :- " & counter1
msgbox "No of 3's :- " &counter2
msgbox "No of 4's :- " &counter3
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..
Explain the concept of object repository and how QTP recognizes objects?
Can you write a script to check if the folder exists or not?
I want to grow as a Automation Engineer,Kindly help me in clearing my interview that what interviewer looks for as a Automation Engineer. I am having three years of experience in testing.
what is the diffrence bw qtp architectute and qtp framework?
in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?
What is the file extension of the code file in qtp?
How do you synchronization point through DP?
what is profile tool?
what are the issues we will get when there is migration from QTP 8.2 to QTP 10.0? Is there any problem in executing scripts of 8.2 on 10.0?
How to define array in qtp?
PLEASE TELL ME WHEN DO YOU USE THE OBJECT SPY AT RUN TIME
How is the Bitmap checkpoint different from Image checkpoint?
Hi, how can we check or avoid the memory leakage in QTP9.2?
What are the main differences of qtp and win runner?