abt filter function

if iam using below two statments its ok
My = Array ("Apples","Oranges", "Apricots")
MyResult = Filter(My, "Oran")

if i use msgbox MyResult

it shows type mismatch
plz help me

Answers were Sorted based on User's Feedback



abt filter function if iam using below two statments its ok My = Array ("Apples","..

Answer / lakshmi

Boss,

Filter function will a zero-based 1-D array. so we have to
use subscript.Filter function may return more than one
matches. then u have to take a loop (for or while) and u
have repeat this loop until ubound of that array.So in u r
case, please see the answer below:

My = Array ("Apples","Oranges", "Apricots")
MyResult = Filter(My, "Oran")
Msgbox MyResult(0)

Here i was mentioed subscript as 0 as we have only one item
which matcehs with u r search.
If there is more than one match, then u have to do likt
this.

My = Array ("Apples","Oranges", "Apricots")
MyResult = Filter(My, "Oran")
For i=0 ubound(MyResult)-1
Msgbox MyResult(i)
Next.

Is This Answer Correct ?    3 Yes 0 No

abt filter function if iam using below two statments its ok My = Array ("Apples","..

Answer / reddy prasad

Hi

thanks lakshmi

regards
reddy prasad
raju16prasad@gmail.com

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

whenever U using QTP,Test Director, Why we using separate Bug tracking tool?

1 Answers  


What is throw object?

1 Answers  


How can we log a defect in Testdirector from Q.T.P ?

2 Answers   EDS,


How is test case write?

0 Answers  


WHAT AREV THE STEPS BETWEEN TEST cASE AND Script generation?

2 Answers  


Tell when we call the function? tell with example.

1 Answers  


Any limitation to XML Checkpoints?

1 Answers  


What is the Difference between Environment variable and Globle variable,.. anybody can give me answer..Thanks in advance...

4 Answers   IBM,


Among all the check points what is the most important checkpoint?

5 Answers   Semantic Space,


I have the script like this: Browser("Philips Web Login").Page("Philips CL DMS2 Application").Frame("ScopeFrame").Link("DC3701737 (Active)").Click in which the value "DC3701737" will get changed and i have to use the same value in so many places. If i want to get that value "DC3701737" in to a variable, how? pls let me know if you didn't get the question. Help me out in this.

2 Answers  


What is keyword driven testing..what is the use of this in Automated testing

2 Answers   IBM,


Give some brief idea about a) Active x check b) Alt property check c) Applet object check d) Frame object check e) Multimedia links check f) Server side image check g) Table object check

1 Answers   CTS,


Categories