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 types of Actions are there in QTP?

6 Answers   Wells Fargo,


Hi Friends, If you got one Bug , and you are insert that bug in bug tracking tool , and you need to attach SC's (screen shots) also. how to tae SC's , in your organization any separate tools available to take SC's. please provide Ans. its urgent... Thanx in advance

3 Answers  


how do you remove object repository at runtime and load object repository and verify it

2 Answers   Thomson Reuters,


Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

0 Answers   SoftTech,


Can u explain about QTP framework

10 Answers   ACS,


How to use output values in qtp ?

0 Answers  


How can we close all webbrowsers which are opened in out desktop?

3 Answers  


How can we do this one ? at runtime qtpwindow and browser aren't disply on monitor (or) aren't visible on desktop?how?

1 Answers  


WAT IS DATA BASE AND XML CHECK POINT ?HOW TO IMPLEMENT IT ... GIVE PROPER EXAMPLE FOR IT

0 Answers   Infosys,


How to break the object spy ?

0 Answers  


Tell me few important difference Between QTP and WinRunner?

3 Answers   Syntel,


How software automation specialist enter steps in the Expert View?

0 Answers  


Categories