Write a program to print all lines that contains a word either “testing” or “qtp”

Answer Posted / syamala usha

set fso = createobject("scripting.filesystemobject")

set f=fso.opentextfile("C:
otes HP.txt",1)


Do until f.atendofstream

str=f.readline

a = split(str," ")

flag=0

for j = 0 to ubound(a)

if (a(j) = "testing") or (a(j) = "qtp") then

flag=1

exit for

end if

next

if flag=1 then

msgbox str

end if

loop

f.close

set f= nothing

set fso =nothing

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the features of visual basic?

1560


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

532


how to write validation function for date in vb script

2150


What are the 2 ways in which a variable can be declared in the vbscript language?

570


Difference between dim,public and private variables in vb script?

535






How will you compare two strings in vbscript?

602


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

557


What is the difference between javascript and vbscript?

543


Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

1421


Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

2039


What is the use of the instr function?

596


How can you create an object in vbscript?

618


How to take whole text output from screen of Bitmap Application.

1877


Explain different types of segment?

581


Mention when to use function procedures and what are its characteristics?

633