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 many scripts do you write per day. What is the average number of scripts you have written in your recent project

1 Answers   CenturyLink, Optum, Value Labs,


Explain how you can delete excel file in qtp?

0 Answers  


How can we do Data driven testing Using For loop in QTP?

2 Answers  


What is All object and Local object in Object Repositary? Explain me please.

3 Answers  


any body want to learn qtp with real time concept on Banking domain contact ciraaj@gmail.com

1 Answers  






want to learn real time automation project(QTP)?

1 Answers  


what are the qtp tester responsibilities?

3 Answers  


We have 10 rows of records in data table, but we have to run 4th, 5th and 6th rows only. How can we handle this scenario in QTP?

5 Answers   Accenture, Banca Sella, Polaris,


How to export quicktest professional results to an .xls file?

0 Answers  


Kindly help me with the following queries.. -- How to recognize webtable using QTP and how to use it? -- How would one conclude that it is a web table -- For Example, if there is a web table and I am clicking on say Cell A1, how would i know that i've clicked on cell A1 -- Kindly suggest me to use the web table better

1 Answers  


how do you run scripts in QTP?please anyone can answer my questions

4 Answers   Ordain Solutions,


how can i call an external action,which is not added external action of an action?

2 Answers   Ordain Solutions,


Categories