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

How to make an Action as reusable?

1 Answers  


I'm facing this problem while automating my application..its a web based apps.. In my application there are few webtables are displaying in the page.In the different cells there are links and action buttons.Problem is there is link in different web tables corresponding to one name.Hence the properties of the objects(say a link) are same except the x,y co ordinate of the object.So my script is not able to distinguish between the two links present in different cells of web tables with same name.Kindly help on this..

3 Answers  


What is QTP and the use of QTP in TD?

0 Answers   MaxSolPro,


Hi All, How to Compare two strings character by character in QTP

0 Answers  


HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?

0 Answers   Wipro,






Hi All, I'm Akshaya here, could anybody please help me regarding how to import the excel sheet to run time datatable. But Pl. keep it in your knowledge is that excel sheet is opened. Thanks, Akshaya Madali 9823213538

4 Answers  


What is operator in VB Script?

1 Answers   IBM,


How To clear the AutoComplete?

1 Answers  


How will you find the current time of the remote machine using QTP script?

0 Answers  


What are the main differences of qtp and win runner?

0 Answers  


What is exact difference between “while” and “do while” in QTP ?

1 Answers  


To retrive the test data which tool vl use and whats basis u vl write test data? its urgent

0 Answers   IBM,


Categories