While writing script using For Next Statement in QTP, I try
defining the variable in Lib File I am getting syntax error
whereas if I use the variable in script file, the script
works fine. Can anyone help me in finding the reason behind
this?.
E:g

Dim intStartRow (Define in Lib File----- say abc.vbs)

Dim intRow (If I define this variable in Lib file I am
getting Syntax error where as if I define in the script
file ---- say xyz.mts the script works fine)

IntStartRow=2

For intRow = intStartRow to xlWrksht.UsedRange.Rows.Count

‘Some Code here

Next



While writing script using For Next Statement in QTP, I try defining the variable in Lib File I am..

Answer / jay prakash

should be some simple error in ur declaration. Nothing big
in this.

Do as below:

In Lib file, MyLib.vbs:
Dim i
i=10

In Script File
msgbox i

Include the lib file and run the script. No error.

If you can share the script i may be able to help u in
identification of your error.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

.qfl extension for which file? where vl use it

1 Answers   iFlex,


Explain about import and export files?

1 Answers  


What is the difference between browser sync and page sync in QTP?

2 Answers  


How can i check items sorted or not in a weblist ? Give me the script for this...

0 Answers  


Can we run test with out adding object in object repository? How it is possible?

0 Answers  


Why is Client side image is preferred over server side image?

0 Answers  


What are the problems / difficulties faced when you used Smart Identification ?

2 Answers   Keane India Ltd,


There is a very good institute for Automation Testing using QTP.For more details please visit jbslearnings.com.

1 Answers  


what is bultin funtaion in QTP &tell me five examples?

5 Answers   Kanbay,


take one exmple and write on that discriptive programe in qtp?

1 Answers  


I have a tool for automation testing (eg:qtp).I have two functionality(A & B) to test.A is tested once in a year. B is tested everyday. At present i have the money and resource availability to automate only one functionality.Which one will u suggest and why?

2 Answers   TCS,


What is quicktest professional window?

0 Answers  


Categories