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

1) How will you associate SOR in Runtime? ( u had written 10 lines of code from 11th line u want associate what code u will write) 2) How will close n number of browser expect only one which is has to test? ( First tell me how will you identify how many browser are opened ) what logic u will use? 3) In web Table u want to click on link ( Link Name Mohamed ) you dont know in which row and column that link is there. how wil u identify and click on that link.

2 Answers  


what questions i have to pripare for project manager round interview ? plz give Ans.(Chandana)

5 Answers   TCS,


What is log file? what is the use of Log fine. How to create? what are the contents and the main advantages of log files. plz do help me in this concepts as i have an interivew on qtp in a couple of days. plz do help me.. thanks in Advance.

1 Answers  


What is the difference between Call to Action and Copy Action?

2 Answers   Satyam,


Out of 3 recording modes. 1.Standard 2.Analog 3.Low-level, which one is commonly used. As per my knowledge, Analog is used for Graphs , barcoding or DIgital signatures.

0 Answers  






1. What is diffrence between Analog Recording And Lomlevel Recording ?

4 Answers  


In a shared Object Repository in QTP if some object is changed how can the other script which is using the same object can be known

6 Answers   iGate,


what is the syntax or command in vbscript to display user message example i want to display "welcome to QTP".

3 Answers  


What are the enhancements u did after recording ur script?

1 Answers  


Ehat is the descriptive programing in QTP?

4 Answers  


How to handle Dynamic Arrays?

0 Answers   Wipro,


Connect to QC using AOM.

0 Answers   Deloitte,


Categories