Write a VB Script to count blank Lines in a notepad

Answer Posted / pravati

Set fso=createobject("scripting.filesystemobject")
Set qfile=fso.OpenTextFile("c:Rinkuaby.txt",1,true)
Do While qfile.AtEndOfStream<>true

x=qfile.ReadLine
msgbox x
If len(x)=0 Then
y=y+1
End If
msgbox y
loop

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it recommended to close the database connection every time after the work is completed?

507


Mention how to assign a date value to a variable?

593


Can anyone send me a vb script function for verifying the functionality of active links on a web page

1606


Explain some uses of vb script?

560


How to Enter Values on the Command promt using VB script

1540






Mention what is vbscript?

603


Explain the constants in vbscript?

570


I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..

1814


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

492


Which operator can be used to do an xor operation in vbscript?

689


For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com

1761


Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...

1660


How are arrays declared in the vbscript language?

553


Illustrate briefly about the different types of statement

2031


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

570