Write a VB Script to count blank Lines in a notepad

Answer Posted / usha

set fso=createobject("scripting.filesystemobject")
set f=fso.opentextfile("C:usha.txt")

c=0

do until (f.atendofstream)

a=f.readline()

if len(a)=0 then



c=c+1

end if


loop

msgbox c

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)

1824


How can you create an object in vbscript?

814


Mention what is the use of option explicit in vbscript?

751


What is the scope of a constant declared using public?

735


How are values assigned to string type and numeric type variables?

742


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2380


There are 5 web pages.write a script to click the button on 4th web page.

3167


How will you get a random number between 0 and 1 in vbscript?

974


What are the different types of loops available in the vbscript language?

720


What is the extension of the vbscript file?

739


How to pass argument by reference to a function in vbscript?

747


What is loose binding? Why is it not a good practice to use it?

851


How can the spaces from the string be removed?

780


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...

1842


Explain about operator precedence in vb script?

811